I have a spreadsheet that contains data in the range A10:G25
I use a combo box to make a selection eg "internal" or External". The output from this selection is stored in cell K3. The output shows either 1 or 2
I want to hide rows based on what that output value is eg if output value is 1 then hide rows 19:25 and if the output value is 2 hide rows from 10:18
Ive tried the following VAB Macro, which is stored in Microsoft excel objects Sheet 1.
The Macro doesn't seem to work (Rows are not hiding) and so I need some help please
Private Sub Worksheet_Change(ByVal Target As Range)
If Range("K3") = "1" Then
Rows("19:25").Hidden = True
ElseIf Range("K3").Value = "2" Then
Rows("10:18").Hidden = True
End If
End Sub
Thanks in Advance for your help
I use a combo box to make a selection eg "internal" or External". The output from this selection is stored in cell K3. The output shows either 1 or 2
I want to hide rows based on what that output value is eg if output value is 1 then hide rows 19:25 and if the output value is 2 hide rows from 10:18
Ive tried the following VAB Macro, which is stored in Microsoft excel objects Sheet 1.
The Macro doesn't seem to work (Rows are not hiding) and so I need some help please
Private Sub Worksheet_Change(ByVal Target As Range)
If Range("K3") = "1" Then
Rows("19:25").Hidden = True
ElseIf Range("K3").Value = "2" Then
Rows("10:18").Hidden = True
End If
End Sub
Thanks in Advance for your help