As the title say is it possible and how?
I have found a .Find
function to search a column for the values I want, is it then possible to save all the addresses in an array?
The code looks like this:
Set wsRaw = Worksheets("raw_list")
Set oRange = wsRaw.Columns(PhaseCol)
SearchString = "control"
Set aCell = oRange.Find(What:=SearchString, LookIn:=xlValues, _
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False)
If Not aCell Is Nothing Then
Set bCell = aCell
FoundAt = aCell.Address
Do While ExitLoop = False
Set aCell = oRange.FindNext(After:=aCell)
If Not aCell Is Nothing Then
If aCell.Address = bCell.Address Then Exit Do
FoundAt = FoundAt & ", " & aCell.Address
Else
ExitLoop = True
End If
Loop
Else
MsgBox SearchString & " not Found"
End If
MsgBox "The Search String has been found these locations: " & FoundAt
Exit Sub
As for now I have a MsgBox
just to show the results. The idea was to store the result in an array if possible.