ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Search macro (https://www.excelbanter.com/excel-programming/317248-search-macro.html)

carg1[_7_]

Search macro
 

I'm trying to make a macro that copies the contents of a cell, pastes i
into the find dialog box, then searches for whatever was pasted.
started it with a recording then tweaked it. Unfortunately, I came t
realize I'm not quite sure how to tell it to paste the copied data int
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).Activat

--
carg
-----------------------------------------------------------------------
carg1's Profile: http://www.excelforum.com/member.php...fo&userid=1527
View this thread: http://www.excelforum.com/showthread.php?threadid=31496


Ron de Bruin

Search macro
 
Hi

Maybe this is useful
http://www.rondebruin.nl/find.htm

Post back if you need more help

--
Regards Ron de Bruin
http://www.rondebruin.nl


"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




Don Guillett[_4_]

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




Dmoney

Search macro
 
Assign to a variable then call it - no copy paste required
and u still have the flexability to change cells after the
assignment.

Dim z As String
Range("B3").Select
z = ActiveCell.Value
Cells.Find(What:=z, After:=ActiveCell,
LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows,
SearchDirection:=xlNext, MatchCase:= _
False).Activate
-----Original 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?

action=getinfo&userid=15271
View this thread:

http://www.excelforum.com/showthread...hreadid=314969

.


Gord Dibben

Search macro
 
carg

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

Gord Dibben Excel MVP

On Thu, 18 Nov 2004 10:47:31 -0600, carg1
wrote:


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




All times are GMT +1. The time now is 02:48 PM.

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