Shade alternate VISIBLE rows only in EXCEL

MJL

New Member
Joined
Nov 7, 2003
Messages
1
I have been trying for a while to crack this problem and so far I have been able to shade alternate rows using conditional formatting. However, my spreadsheet has a filter attached to it and I only need the alternate shading to be applied to the VISIBLE rows (after the filter has been applied).
The current result gives me a barcode affect where shading of the VISIBLE rows are not alternate and appear random.

I hope I have explained myself well enough for you to understand my problem.

I appreciate any help

Thank you
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Hi,
If you use conditional formatting with Formula is:
=EVEN((SUBTOTAL(3,$A$1:A1)))=SUBTOTAL(3,$A$1:A1)
It will colour every second even if you filter.
 
Upvote 0
fairwinds said:
Hi,
If you use conditional formatting with Formula is:
=EVEN((SUBTOTAL(3,$A$1:A1)))=SUBTOTAL(3,$A$1:A1)
It will colour every second even if you filter.

That's excellent! (y)
 
Upvote 0
That's excellent! (y)[/quote]

I agree. I have wanted to do this for years. Wonderful, fairwinds :LOL:
 
Upvote 0
On further checking, the formula works on a single column but when applied to a range across columns (e.g. A1:F10) it gives a part-checkerboard effect. Is there a way of modifying the formula to prevent this?
 
Upvote 0
I think this works too using conditional formatting and seemed to work with filtering on a quick test.

to colour odd row first
=MOD(ROW(),2)=0

to colour even row first
=MOD(ROW(),2)=1

EDIT
I take that back, it failed on another test so as you were. Seems to only work with filtering off. :oops:
 
Upvote 0
Andrew Poulsom said:
Just take out the absolute reference to column A:

=EVEN((SUBTOTAL(3,A$1:A1)))=SUBTOTAL(3,A$1:A1)

Hi, Andrew, I tried that but it only works if all cells contain something. A single empty cell reverses the row in question.
 
Upvote 0
Somewhere in your filter range you need a column with entries in all rows. Then you let your formula refere to that column.
 
Upvote 0

Forum statistics

Threads
1,215,261
Messages
6,123,931
Members
449,134
Latest member
NickWBA

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top