Hello everyone,
I need help on looping through a range and finding a value. My code:
myCell is a string that I am searching for. I set foundsub somewhere else, resize it and then use it to try and find myCell. I know foundsub is being found and resized but for some reason FoundCell is being set to nothing and I get back "Didn't find"
Also, I know that the string myCell is within the range but it is still returning nothing.
Help!
Thanks in advance
I need help on looping through a range and finding a value. My code:
Code:
MsgBox foundsub.Address
Set foundsub = foundsub.Resize(1000, 1000)
With foundsub
Set FoundCell = .Find(What:=myCell, _
After:=.Cells(.Cells.count), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
End With
If FoundCell Is Nothing Then
MsgBox "Didn't find"
End If
Also, I know that the string myCell is within the range but it is still returning nothing.
Help!
Thanks in advance