ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find in Recorded Macro (https://www.excelbanter.com/excel-programming/430878-find-recorded-macro.html)

Robert

Find in Recorded Macro
 
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

--
Robert

Rick Rothstein

Find in Recorded Macro
 

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.

--
Rick (MVP - Excel)


"Robert" wrote in message
...
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

--
Robert



Robert

Find in Recorded Macro
 

Thanks Rick. I thought I tried all permutations.
--
Robert





All times are GMT +1. The time now is 11:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com