Wim Geuens
Member
hello,
can someone tell me how i can search in a column range.
I can make it work for the rows, but not for the colums
thanks!
WIm
can someone tell me how i can search in a column range.
I can make it work for the rows, but not for the colums
thanks!
WIm
Code:
Public Sub Group()
Dim nColumn As Long
Dim nStart As Long, nEnd As Long
Dim i As Integer
i = 1
Do
For nColumn = A To AAA
If Range(nColumn & "4").Value = i Then
nStart = nColumn
Exit For
End If
Next nColumn
For nColumn = nStart To AAA
If Range(nColumn & "4").Value <> i Then
nEnd = nRow
Exit For
End If
Next nColumn
nEnd = nEnd - 1
Columns(nStart & ":" & nEnd).Select
Selection.Columns.Group
i = i + 1
Loop Until i = 52
End Sub