Thread: Search macro
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett[_4_] Don Guillett[_4_] is offline
external usenet poster
 
Posts: 2,337
Default Search macro

try
Cells.Find(What:=selection, After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,

--
Don Guillett
SalesAid Software

"carg1" wrote in message
...

I'm trying to make a macro that copies the contents of a cell, pastes it
into the find dialog box, then searches for whatever was pasted. I
started it with a recording then tweaked it. Unfortunately, I came to
realize I'm not quite sure how to tell it to paste the copied data into
find. Any ideas? Here's my code:

Dim Term

Term = Selection.Copy
Cells.Find(What:="Term", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
_
MatchCase:=False).Activate


--
carg1
------------------------------------------------------------------------
carg1's Profile:

http://www.excelforum.com/member.php...o&userid=15271
View this thread: http://www.excelforum.com/showthread...hreadid=314969