Worksheet contains 16 buttons labelled "0100", "0200", etc to "1600" that are used to hide/unhide rows based on cells contents. Code below:
ActiveSheet.Unprotect "password"
Application.ScreenUpdating = False
For Each cell In Range("k91:k153")
If cell.EntireRow.Hidden = True Then
cell.EntireRow.Hidden = False
Else
If cell.Value = "0" Then
cell.EntireRow.Hidden = True
End If
End If
Next cell
Application.ScreenUpdating = True
ActiveSheet.Protect "password"
End Sub
This works great as long as no rows are added or deleted within the range. When a rows are added, it pushes the same number of rows outside of the range.
Is it possible to perform the hide/unhide between two cell values/labels in Column A instead of dedicated row numbers that I have now? The beginning of each hide/unhide Range starts with a cell in Column A having text "R.x" and ending with "R.x.x". I would need the hide/unhide to start one row below "R.x" and one row above "R.x.x".
Thanks
TJL
ActiveSheet.Unprotect "password"
Application.ScreenUpdating = False
For Each cell In Range("k91:k153")
If cell.EntireRow.Hidden = True Then
cell.EntireRow.Hidden = False
Else
If cell.Value = "0" Then
cell.EntireRow.Hidden = True
End If
End If
Next cell
Application.ScreenUpdating = True
ActiveSheet.Protect "password"
End Sub
This works great as long as no rows are added or deleted within the range. When a rows are added, it pushes the same number of rows outside of the range.
Is it possible to perform the hide/unhide between two cell values/labels in Column A instead of dedicated row numbers that I have now? The beginning of each hide/unhide Range starts with a cell in Column A having text "R.x" and ending with "R.x.x". I would need the hide/unhide to start one row below "R.x" and one row above "R.x.x".
Thanks
TJL