I want to make a search for a number or a string in excel. Is there anyone who can help me? Regards. Clint
Printable View
I want to make a search for a number or a string in excel. Is there anyone who can help me? Regards. Clint
Good luck!Code:'this code assumes you have declared and created the
'Excel.Application object and called it xl
xl.Cells.Find(What:="TheStringToSearchFor", _
After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False).Activate
thank you very much. you are great.
joacim, could u please show me how to declare variables such as ActiveCell? When I run the code, it gives "variable not defined" error message.
Sorry it should say: xl.ActiveCell
ActiveCell is a property of the Excel.Application object.