Dear all,
I am trying to develop the macro to get Output as mentioned in a attachment
I am done upto code as below but i want only unique values(first 3 letters of each cell) to be added in "sloop" variable.
can anyone please help me to correct the below code..?
The problem is in line code : ElseIf InStr(1, sloop, xSub) = 1
Just in order to get best possible solution, this querry is cross posted @
http://www.ozgrid.com/forum/showthread.php?t=200350
Sub test()
Dim xSub As String
Dim sloop As Variant
For Each cell In ActiveSheet.Range("A2", ActiveSheet.Cells(Rows.Count, "A").End(xlUp))
If cell.Value <> "" Then
xSub = Left(cell.Value, 3)
If sloop = Empty Then
sloop = xSub
'ElseIf InStr(aa, dd) Then
ElseIf InStr(1, sloop, xSub) = 1 Then
GoTo iteration:
Else: sloop = sloop & "," & xSub
End If
End If
iteration:
Next cell
End Sub
Bookmarks