From: ordnance1 on 20 Mar 2010 00:18 I need to be able to hide/unhide rows base upon a value. If cell P5 has a value of 1, then hide rows 6,7,8 and 9 If cell P5 has a value of 2, then hide rows 7,8 and 9 If cell P5 has a value of 3, then hide rows 8 and 9 If cell P5 has a value of 4, then rows 6, 7, 8 and 9 would be visible Would like to do this as a WorksheetChange event.
From: Rick Rothstein on 20 Mar 2010 01:22 Give this Change event code a try... Private Sub Worksheet_Change(ByVal Target As Range) Dim N As Long If Target.Address = "$P$5" Then N = Target.Value If N > 0 And N < 5 Then Rows("6:9").Hidden = False If N < 4 Then Rows((5 + N) & ":9").Hidden = True End If End If End Sub Rick (MVP - Excel) "ordnance1" <ordnance1(a)comcast.net> wrote in message news:uOf#YR#xKHA.2436(a)TK2MSFTNGP04.phx.gbl... > I need to be able to hide/unhide rows base upon a value. > > If cell P5 has a value of 1, then hide rows 6,7,8 and 9 > If cell P5 has a value of 2, then hide rows 7,8 and 9 > If cell P5 has a value of 3, then hide rows 8 and 9 > If cell P5 has a value of 4, then rows 6, 7, 8 and 9 would be visible > > Would like to do this as a WorksheetChange event.
|
Pages: 1 Prev: Making my App only work so many times Next: What is the bar and function name for refresh all? |