Find in Recorded Macro

  • Thread starter Thread starter Robert
  • Start date Start date
R

Robert

I cannot seem to identify the mistake is this recorded (and edited) macro.
Thde query text will appear in cell B1. Would appreciate assistance. Thank
you.

Sub Macro1A()

Cells.Find(what:=.Range("B1").Value, After:=ActiveCell,
LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Activate
End Sub
 
You have a "dot" in front of the Range reference, but you don't have a With
statement for it to reference back to. Try removing that dot and see what
happens.
 
Back
Top