Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
hide zero rows / shadwe every other visible
Hi everyone. I found this code on the newsgroup from Tom Ogilvy. The
hidig of the cells workd great, but I can't seem to get the shading of every other visible row. Any ideas what I'm doing wrong? Thanks! Dim Cell As Range Dim i As Long Set Sh = ActiveSheet Application.ScreenUpdating = False With Sh '----------Hide rows where B's value is zero---------- .Range("A7:L160").Interior.ColorIndex = xlNone i = 1 For Each Cell In .Range("B7:B160") If Cell.Value = 0 Then Cell.EntireRow.Hidden = True Else Cell.EntireRow.Hidden = False If i = 1 Then Cell.Offset(0, -1).Resize(1, 11). _ Interior.ColorIndex = 37 End If i = (i + 1) Mod 2 End If Next Cell End With |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
hide zero rows / shadwe every other visible
Never mind! Stupid mistake on my part!! Thanks.
On Oct 10, 11:45 am, Steve wrote: Hi everyone. I found this code on the newsgroup from Tom Ogilvy. The hidig of the cells workd great, but I can't seem to get the shading of every other visible row. Any ideas what I'm doing wrong? Thanks! Dim Cell As Range Dim i As Long Set Sh = ActiveSheet Application.ScreenUpdating = False With Sh '----------Hide rows where B's value is zero---------- .Range("A7:L160").Interior.ColorIndex = xlNone i = 1 For Each Cell In .Range("B7:B160") If Cell.Value = 0 Then Cell.EntireRow.Hidden = True Else Cell.EntireRow.Hidden = False If i = 1 Then Cell.Offset(0, -1).Resize(1, 11). _ Interior.ColorIndex = 37 End If i = (i + 1) Mod 2 End If Next Cell End With |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to make a few rows visible and hide some others ... faster | Excel Programming | |||
Hide a visible rows | Excel Discussion (Misc queries) | |||
excel hide and visible problem | Excel Programming | |||
Hide (visible+AD0-false) all open applications? | Excel Programming | |||
Hide (visible+AD0-false) all open applications? | Excel Programming |