I am trying to run a simple command which didn't work
Error: Object variable or with block not set
I then thought this might run as a macro substition (EG build the string then execute it):
However, for the life of me I cannot remember how the hell to do this. I don't understand why you can't substitute a variable into a command to force me to look at doing this anyway. Can someone put me out of my misery.
Thanks
Mark Davies
Warwickshire County Council
Code:
Cells.Find(What:=Chr(34) + Trim(strRef) + Chr(34), After:=ActiveCell, LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False).Activate
Error: Object variable or with block not set
I then thought this might run as a macro substition (EG build the string then execute it):
Code:
strcommand = "Cells.Find(What:=" + Chr(34) + Trim(strRef) + Chr(34) + ", After:=ActiveCell, LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False).Activate"
???? run StrCommand ????
However, for the life of me I cannot remember how the hell to do this. I don't understand why you can't substitute a variable into a command to force me to look at doing this anyway. Can someone put me out of my misery.
Thanks
Mark Davies
Warwickshire County Council