ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Ctrl+F Find by value (https://www.excelbanter.com/excel-programming/421608-ctrl-f-find-value.html)

swtupr

Ctrl+F Find by value
 
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

Luke M

Ctrl+F Find by value
 
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.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"swtupr" wrote:

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


swtupr

Ctrl+F Find by value
 
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

"Luke M" wrote:

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.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"swtupr" wrote:

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



All times are GMT +1. The time now is 02:57 AM.

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