Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello
I am using the following code to hide/unhide rows: Private Sub CommandButton1_Click() Application.ScreenUpdating = False Dim I As Long Dim Hidden As Boolean ' For i = 14 To Cells(Rows.Count, "A").End(xlUp).Row For I = 14 To 83 If Rows(I).EntireRow.Hidden Then Hidden = True Rows(I).EntireRow.Hidden = False End If Next I If Hidden Then Exit Sub ' For i = 14 To Cells(Rows.Count, "A").End(xlUp).Row For I = 14 To 83 If Cells(I, 1).Value < "BA" Then ' Range(Cells(I, 1), Cells(I + 9, 1)).EntireRow.Hidden = True Rows(I).Hidden = True End If Next I End Sub This works fine up to 83 rows. I am trying to modify to use the last row istead of hard coded row number. My attempts to modify (which arent working) have been commented out. What am I doing wrong? Thanks |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Enabling option „Format rows“ to hide/unhide rows using VBA-code? | Excel Discussion (Misc queries) | |||
How to Hide and Unhide Rows | Excel Discussion (Misc queries) | |||
Hide Unhide Rows | Excel Discussion (Misc queries) | |||
Hide/Unhide rows | Excel Programming | |||
How to hide and unhide rows | Excel Programming |