Ctrl+F Find by value

S

swtupr

1. When finding a text in Excel i want to look in Values instead of formulae.
Is there a way to do this without actually changing the options in the Find
and replace dialaog manually. Can this be done automatically through code?
2. Also, When i do Ctrl+F and find something, Excel finds the value in the
hidden columns also. I dont want to highlight the hidden columns when
searching. Any work around for this?


Thanks
 
L

Luke M

Definied in the LookIn parameter

Cells.Find(What:="MyWord", After:=ActiveCell, LookIn:=xlValues, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:=False _
, SearchFormat:=False).Activate

By searching values, XL disregards hidden columns, so solves 2 problems at
once.
 
S

swtupr

Thanks for your quick reply Luke.
I want this behaviour of find when the user hits Ctrl+f. So where do i put
the code line which you specified. The find and replace dialog has to to
appear with the option look in Xlvalues.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top