#1   Report Post  
Posted to microsoft.public.excel.misc
Frank
 
Posts: n/a
Default Define Startrow

Hello,

I have a macro that I use to automatically unhide the first row of a
group of hidden rows:

Sub UnhideFirstRow()
startrow = ActiveSheet.UsedRange.Row
stoprow = startrow + ActiveSheet.UsedRange.Rows.Count - 1
For i = startrow To stoprow
If Rows(i).Hidden Then
Rows(i).Hidden = False
Exit For
End If
Next i
End Sub

How can I define the startrow to use the first visible row instead of
the first row with data? My spreadsheet is set up that I have a set of
unhidden rows with hidden rows at the top and bottom of the page.
(e.g. row 1 has header info that is unhidden and frozen, rows 2-10
hidden but with valid "old" data, rows 11-30 unhidden with current
data, rows 31-50 hidden and will be used for data entry once unhidden)
The macro above unhides row 2 and I would like it to unhide 31.

Thanks,

Frank

PS- I can't use a macro that has a predefined row x because every
worksheet has a different "range" of unhidden cells.

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
Define name digicat Excel Discussion (Misc queries) 6 January 19th 06 05:54 PM
Define Names in Excel Dave T at home Excel Discussion (Misc queries) 2 November 1st 05 03:27 PM
Define a chart using VBA Pim Charts and Charting in Excel 1 September 27th 05 10:57 PM
Define Name use in Macros Bill Christian Excel Discussion (Misc queries) 3 July 15th 05 03:43 AM
I can define a name, but I cannot use the name - menu Insert-Name-Use is blank Zdenek Moravec Excel Discussion (Misc queries) 4 April 15th 05 02:55 PM


All times are GMT +1. The time now is 09:56 AM.

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

About Us

"It's about Microsoft Excel"