PDA

View Full Version : How to Retrieve the Last Search Term from Find()



mailman
07-11-2008, 11:54 AM
Hi all.

You know when you run a Find or Find/Replace how the search term or 'Find What:' value remains the next time you run a Find or Find/Replace?

What I'm wanting to do is get and store that previously used search term in a variable, run a programmatic search for another term, then restore the previously used search term.

So, the flow would be the following (Assuming the last search term was "Batman")

Store the last search term ("Batman") in a var
Perform the programattic Find for the word "Joker"
Activate the found cell or do nothing if not found
Replace the last search term word "Joker" with the word "Batman"Hopefully this makes sense. I'm running out of Excel 2003, and just need the syntax to get/set the last used search term.

Thanks! :hi: