Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Conditional Hide Rows Macro
I want a macro to do a conditional hide automatically based on another
value in another cell. For example: If Cell A1 = "Yes" then hide rows 20:23 If Cell A1 = "No" then do not hide rows 20:23 The closest thing i can find is the below example which hides the row based on the value (in the same row) in column T Private Sub Worksheet_Change(ByVal Target As Excel.Range) Select Case Range("T" & Target.Row).Value Case Is = "Y" Target.EntireRow.Hidden = True Case Is = "N" Target.EntireRow.Hidden = False End Select End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Conditional Hide Rows Macro
Try this: Private Sub Worksheet_Change(ByVal Target As Excel.Range) Select Case ucase(Range("a1").Value) case "YES" [20:23].entirerow.hidden = true case else [20:23].entirerow.hidden = false End Select End Sub Col -- colofnature ------------------------------------------------------------------------ colofnature's Profile: http://www.excelforum.com/member.php...o&userid=34356 View this thread: http://www.excelforum.com/showthread...hreadid=548938 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Conditional Hide Rows Macro
colofnature wrote: Try this: Private Sub Worksheet_Change(ByVal Target As Excel.Range) Select Case ucase(Range("a1").Value) case "YES" [20:23].entirerow.hidden = true case else [20:23].entirerow.hidden = false End Select End Sub Col -- colofnature ------------------------------------------------------------------------ colofnature's Profile: http://www.excelforum.com/member.php...o&userid=34356 View this thread: http://www.excelforum.com/showthread...hreadid=548938 That works great! Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Using VBA to Conditional Hide Rows? | Excel Discussion (Misc queries) | |||
Conditional macro to hide rows | Excel Programming | |||
Conditional macro to hide rows | Excel Programming | |||
Conditional Hide rows with zero | Excel Programming | |||
Conditional hide rows macros | Excel Programming |