Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Define name | Excel Discussion (Misc queries) | |||
Define Names in Excel | Excel Discussion (Misc queries) | |||
Define a chart using VBA | Charts and Charting in Excel | |||
Define Name use in Macros | Excel Discussion (Misc queries) | |||
I can define a name, but I cannot use the name - menu Insert-Name-Use is blank | Excel Discussion (Misc queries) |