Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 201
Default Find a hidden entry

Excel 2002, WinXP
The code below is a simplification of my code to demonstrate my problem.
I have a, b, c, d, e in A1:A5.
Rows 3:5 are hidden rows
I want to search the range A1:A5, in VBA, to find the row number of the "c"
entry.
This code will not work because Row 3, the "c" row, is hidden.
My intent is to find the row, unhide it, and work with it.
Question: Is there a way to find the row number of the "c" entry, short of
unhiding the whole Rng first?
One way is to loop through Rng and look for "c". Is there a better way?
Thanks for your help. Otto

Sub FindHidden()
Dim Rng As Range
Dim c As Long
Set Rng = [A1:A5]
c = Rng.Find(What:="c", _
After:=[A1], LookIn:=xlValues, LookAt:=xlWhole).Row
MsgBox c
End Sub


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Find a hidden entry

Hi Otto,

Worksheetfunction Match doesn't care about hidden rows

Dim Rng As Range
Dim c As Long
Set Rng = Range("A1:A5")
c = WorksheetFunction.Match("c", Rng, 0)
MsgBox c


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Otto Moehrbach" wrote in message
...
Excel 2002, WinXP
The code below is a simplification of my code to demonstrate my problem.
I have a, b, c, d, e in A1:A5.
Rows 3:5 are hidden rows
I want to search the range A1:A5, in VBA, to find the row number of the

"c"
entry.
This code will not work because Row 3, the "c" row, is hidden.
My intent is to find the row, unhide it, and work with it.
Question: Is there a way to find the row number of the "c" entry, short

of
unhiding the whole Rng first?
One way is to loop through Rng and look for "c". Is there a better way?
Thanks for your help. Otto

Sub FindHidden()
Dim Rng As Range
Dim c As Long
Set Rng = [A1:A5]
c = Rng.Find(What:="c", _
After:=[A1], LookIn:=xlValues, LookAt:=xlWhole).Row
MsgBox c
End Sub




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 201
Default Find a hidden entry

Don, Bob
Thanks for both tips. They both work just fine. Otto
"Otto Moehrbach" wrote in message
...
Excel 2002, WinXP
The code below is a simplification of my code to demonstrate my problem.
I have a, b, c, d, e in A1:A5.
Rows 3:5 are hidden rows
I want to search the range A1:A5, in VBA, to find the row number of the

"c"
entry.
This code will not work because Row 3, the "c" row, is hidden.
My intent is to find the row, unhide it, and work with it.
Question: Is there a way to find the row number of the "c" entry, short

of
unhiding the whole Rng first?
One way is to loop through Rng and look for "c". Is there a better way?
Thanks for your help. Otto

Sub FindHidden()
Dim Rng As Range
Dim c As Long
Set Rng = [A1:A5]
c = Rng.Find(What:="c", _
After:=[A1], LookIn:=xlValues, LookAt:=xlWhole).Row
MsgBox c
End Sub




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find last row with hidden rows Sherry Excel Discussion (Misc queries) 2 October 13th 08 08:01 PM
how to find out if a row is hidden Ray Excel Worksheet Functions 3 August 29th 08 05:05 AM
DATEDIF() The hidden function - You may find it useful. Dave Thomas Excel Worksheet Functions 1 July 16th 07 04:56 PM
How to find hidden text Judy Ward Excel Worksheet Functions 0 January 20th 06 01:33 AM
Find Last Row Hidden John Wilson Excel Programming 1 January 21st 04 01:07 PM


All times are GMT +1. The time now is 06:53 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"