Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default How can I shade every other row with some rows hidden (autofilter

You really only want to shade every other visible row. So use this condition
in you logic:


Sub alter()
Dim L As Long, pong As Boolean
pong = True
For L = 1 To 100
If Rows(L).EntireRow.Hidden = False Then
If pong Then
Rows(L).Interior.ColorIndex = 2
Else
Rows(L).Interior.ColorIndex = 4
End If
pong = Not pong
End If
Next L
End Sub

Autofilter make rows hidden, so we skip hidden rows when painting alternate
colors.
--
Gary''s Student


"dlindamood" wrote:

How can I shade every other row of an excel spredsheet. Some of the rows are
hidden with the auto filter on. My results always end up with the even rows
gray and the odd rows clear. With the autofilter on, some times the odd rows
are adjacent, and sometimes the even rows are adjacent. This results in a
random coloring of the rows.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
shade hidden rows TJ Excel Discussion (Misc queries) 6 January 19th 06 02:43 AM
Shade rows A:J Elaine Excel Programming 8 February 22nd 05 01:57 PM
AutoFilter & Hidden Rows John[_88_] Excel Programming 2 July 22nd 04 03:28 AM
Excel VBA - hidden rows / autofilter cata_and[_4_] Excel Programming 6 June 8th 04 08:54 AM
AutoFilter and Hidden Rows Greg Bloom Excel Programming 1 September 25th 03 11:16 PM


All times are GMT +1. The time now is 01:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"