Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default Finding the first cell in a column that is not hidden

Hi,

I need to find the first cell in a column that is not hidden. I am
not sure how to go about this. Any ideas?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Finding the first cell in a column that is not hidden

Hidden cell? Do you mean you have hidden **rows** and you are looking for
the first ROW that is not hidden? This code will do that...

Dim C As Range
For Each C In Rows
If C.Hidden Then
MsgBox "First hidden row: " & C.Address
Exit For
End If
Next

Just replace the MsgBox call with whatever you want to do with that row.

Rick


"R Tanner" wrote in message
...
Hi,

I need to find the first cell in a column that is not hidden. I am
not sure how to go about this. Any ideas?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default Finding the first cell in a column that is not hidden

I am trying to figure out a way to use the find method, but I can't
figure out how to specify the criteria as being an unhidden row...
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Finding the first cell in a column that is not hidden

To the best of my knowledge, the Find method only finds data, not column or
row 'hiddenness'.

By the way, here is a function that will return the number of the first
hidden row...

Function FirstHiddenRow()
If Not Rows(1).Hidden Then FirstHiddenRow = Split(Split(Cells. _
SpecialCells(xlCellTypeVisible).Rows.Address(False ), ",")(0), ":")(1)
FirstHiddenRow = FirstHiddenRow + 1
End Function

Note this uses a totally different method to find the first hidden row than
my earlier posted code (no loops). I am not sure whether it is more
efficient than this function (built around the concept of my earlier posted
code)...

Function FirstHiddenRow()
Dim R As Range
For Each R In Rows
If R.Hidden Then
FirstHiddenRow = R.Row
Exit For
End If
Next
End Function

I'm thinking this last one may be the more efficient of the two (since the
first one makes two calls to the somewhat 'slowish' Split function).

Rick


"R Tanner" wrote in message
...
I am trying to figure out a way to use the find method, but I can't
figure out how to specify the criteria as being an unhidden row...


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default Finding the first cell in a column that is not hidden

Thank you for the information...I used the
'Selection.SpecialCells(xlCellTypeVisible).Select' method to retrieve
the values I was looking for...

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
2007 Worksheet, Hidden Columns, .CSV Format Saves Hidden Column Da Tammy Excel Discussion (Misc queries) 3 April 2nd 09 11:40 PM
Finding the first cell in column where value < 0 WannaBeExceller Excel Programming 2 March 15th 06 03:50 AM
Last cell in column (with hidden rows) Pink Panther Excel Programming 2 July 8th 05 09:19 PM
Finding column of a particular cell Prema Excel Programming 4 February 7th 05 06:44 PM
Finding the last used cell in a column Ben's Oak Excel Programming 5 July 16th 04 04:12 AM


All times are GMT +1. The time now is 01:20 PM.

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"