Hi,
I found the code from this forum and trying to test but got error message:
I found the code from this forum and trying to test but got error message:
VBA Code:
Sub LoopEachName()
Dim aNames As Variant, Itm As Variant
With Range("A1", Range("A" & Rows.Count).End(xlUp))
.AdvancedFilter Action:=xlFilterInPlace, Unique:=True
aNames = .Offset(1).Resize(.Rows.Count - 1).SpecialCells(xlVisible).Value
[COLOR=rgb(184, 49, 47)][B]For Each Itm In aNames <=== I got error message from this line[/B][/COLOR]
.AutoFilter Field:=1, Criteria1:=Itm
'Do whatever you want with an individual name here
Next Itm
.AutoFilter
End With
End Sub