How do I alternate between two colors?

Andries

Board Regular
Joined
Feb 3, 2011
Messages
127
Hi

How do I Alternate between two colors ...(lets say grey and white) I have a list of 700 names and depending of what the total is added next to these names the macro would duplicate each name and paste it onto a new sheet. I want to know if there is a way to then color the back ground off the range of cells that are the same and then change to another color when there is another set of names and so on

thx

Dries
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Another way is to use a helper column. The disadvantage here is it does take another column, but the advantage is the CF formulas are simple (and the helper column can be hidden)

Formula in B2 copied down.
B2:Bxx selected then the Conditional Formatting shown is applied.

Excel Workbook
AB
1Name
2Name 11
3Name 11
4Name 11
5Name 11
6Name 20
7Name 31
8Name 31
9Name 31
10Name 40
11Name 40
12Name 40
13
CF in groups
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A21. / Formula is =NOT(B2)Abc
A22. / Formula is =B2Abc
 
Upvote 0

Forum statistics

Threads
1,224,599
Messages
6,179,828
Members
452,946
Latest member
JoseDavid

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