Hi,
I am trying to search a word in the activesheet using the following code. VBA is behaving strangely, in that, when I run the macro it is not able to find the word, even though the word is there in the worksheet. However, when I step through the macro (using F8) the Find function is able to find the word.
I am not sure what is going on here.
Thanks.
I am trying to search a word in the activesheet using the following code. VBA is behaving strangely, in that, when I run the macro it is not able to find the word, even though the word is there in the worksheet. However, when I step through the macro (using F8) the Find function is able to find the word.
I am not sure what is going on here.
Code:
[FONT=Arial]…[/FONT]
[FONT=Arial]ActiveSheet.UsedRange.Select[/FONT]
[FONT=Arial]Srch = "Net Absorption"[/FONT]
[FONT=Arial]Selection.Find(What:=Srch, After:=ActiveCell, LookIn:=xlValues, _[/FONT]
[FONT=Arial]LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _[/FONT]
[FONT=Arial]MatchCase:=False).Activate[/FONT]
Thanks.