ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How To: VBA Cells.Find(..... also look in hidden columns? (https://www.excelbanter.com/excel-programming/288023-how-vba-cells-find-also-look-hidden-columns.html)

Kevin McCartney[_2_]

How To: VBA Cells.Find(..... also look in hidden columns?
 
Hi,
I'm try to find a value in a specific column. The column
itself is hidden.

I use the command, rgeUniqueID.Cells.Find
(What:=strFindUniqueID, LookIn:=xlValues,
SearchOrder:=xlRows, MatchCase:=False)

The code works fine when the column is not hidden. The
point is that I don't want to hide and show the column
each time a need to search for a Unique ID.

Thanks for your help
regards
KM


Tom Ogilvy

How To: VBA Cells.Find(..... also look in hidden columns?
 
If you replace xlValues with xlFormulas, it works for me with a hidden
column.

--
Regards,
Tom Ogilvy

"Kevin McCartney" wrote in message
...
Hi,
I'm try to find a value in a specific column. The column
itself is hidden.

I use the command, rgeUniqueID.Cells.Find
(What:=strFindUniqueID, LookIn:=xlValues,
SearchOrder:=xlRows, MatchCase:=False)

The code works fine when the column is not hidden. The
point is that I don't want to hide and show the column
each time a need to search for a Unique ID.

Thanks for your help
regards
KM




Tim Zych[_4_]

How To: VBA Cells.Find(..... also look in hidden columns?
 
Hmmm, it doesn't see to like the xlValues parameter.

Trying to replicate the approach:

rngUniqueID.Cells.SpecialCells(xlCellTypeConstants ). _
Find(What:=strFindUniqueID, LookIn:=xlFormulas, _
SearchOrder:=xlRows, MatchCase:=False)

seems to work for hidden columns.

Specialcells has a disadvantage in that it can't be used in a protected
sheet. Reprotecting the sheet with userinterfaceonly will work around that
limitation if applicable.


"Kevin McCartney" wrote in message
...
Hi,
I'm try to find a value in a specific column. The column
itself is hidden.

I use the command, rgeUniqueID.Cells.Find
(What:=strFindUniqueID, LookIn:=xlValues,
SearchOrder:=xlRows, MatchCase:=False)

The code works fine when the column is not hidden. The
point is that I don't want to hide and show the column
each time a need to search for a Unique ID.

Thanks for your help
regards
KM




Kevin McCartney[_2_]

How To: VBA Cells.Find(..... also look in hidden columns?
 
To banana it works
Cheers buddy
regards
KM
-----Original Message-----
If you replace xlValues with xlFormulas, it works for me

with a hidden
column.

--
Regards,
Tom Ogilvy

"Kevin McCartney"

wrote in message
...
Hi,
I'm try to find a value in a specific column. The

column
itself is hidden.

I use the command, rgeUniqueID.Cells.Find
(What:=strFindUniqueID, LookIn:=xlValues,
SearchOrder:=xlRows, MatchCase:=False)

The code works fine when the column is not hidden. The
point is that I don't want to hide and show the column
each time a need to search for a Unique ID.

Thanks for your help
regards
KM



.



All times are GMT +1. The time now is 07:46 AM.

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