Hello all,
I have a challenge. I want to do a table that changes its structure. Is about a block of flats. I need to modify the number of stairway and the number of floors (biggest). Here i received a code to hide/unhide the number of stairway. If i have 3 stairways (based on a cell value "A1") i hide columns from stairway 4 to 8. I want to know if i could do in the same time with the number of rows (floors) based on "A2" value to hide/unhide from row 2 to 15.The code to hide/unhide a number of columns is:
Thanks to Rick Rothstein.
I have a challenge. I want to do a table that changes its structure. Is about a block of flats. I need to modify the number of stairway and the number of floors (biggest). Here i received a code to hide/unhide the number of stairway. If i have 3 stairways (based on a cell value "A1") i hide columns from stairway 4 to 8. I want to know if i could do in the same time with the number of rows (floors) based on "A2" value to hide/unhide from row 2 to 15.The code to hide/unhide a number of columns is:
Code:
Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address(0, 0) = "C3" Then
If Target.Value > 0 And Target.Value < 9 Then
Columns("E:K").Hidden = False
If Target.Value < 8 Then Range(Columns("D").Offset(, Target.Value), "K:K").EntireColumn.Hidden = True
End If
End If
End Sub
Thanks to Rick Rothstein.