conditional formatting - shade alternate rows dynamically

DDT~123

Board Regular
Joined
May 31, 2012
Messages
220
Greetings all - I have a spreadsheet with data in range B8:AB200. Sometimes the range would be less than row 200. I'm needing to shade every other row, except if the bottom most row is blank. In other words, sometimes every other row from B8:AB164 would need to be shaded if B165 is blank.
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Select rows 8:200 and enter this Conditional Formatting formula:
Code:
=AND($B8<>"",MOD(ROW(),2)=0)
and choose your fill color for your shading.
 
Upvote 0
Thank you! It worked well! I don't suppose there's an easy way to maintain the same every other row when using the data filter/sort is there? No biggie if not.
 
Upvote 0
Thank you! It worked well! I don't suppose there's an easy way to maintain the same every other row when using the data filter/sort is there?
Since it is working off row number, I don't think so. Conditional Formatting cannot determine which row numbers are visible or not.
Something like that would probably require VBA.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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