Change the colour of rows when the value in the first column changes

chan_a1

New Member
Joined
Aug 20, 2009
Messages
12
Hi

Wondering if someone can help me with this query. I have a spreadsheet of account numbers and customer Name. I would like the rows to change colour when there is a change in the account numbers.

Eg the first 2 columns would be like this

Account Number Customer Name
<table width="229" border="0" cellpadding="0" cellspacing="0"><col style="width: 48pt;" width="64"> <col style="width: 124pt;" width="165"> <tbody><tr style="height: 12.75pt;" height="17"> <td class="xl68" style="height: 12.75pt; width: 48pt;" width="64" align="right" height="17">100241</td> <td class="xl69" style="width: 124pt;" width="165"> Mr Smith</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl68" style="height: 12.75pt;" align="right" height="17">100241</td> <td class="xl69"> Mr Richard </td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl67" style="height: 12.75pt;" align="right" height="17">100283</td> <td class="xl70"> Cuthbertson</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl68" style="height: 12.75pt;" align="right" height="17">100302</td> <td class="xl69"> Varnor Pty Ltd</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl68" style="height: 12.75pt;" align="right" height="17">100302</td> <td class="xl69"> Varnor Pty Ltd</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl67" style="height: 12.75pt;" align="right" height="17">100334</td> <td class="xl70"> John & Thompson</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl68" style="height: 12.75pt;" align="right" height="17">100372</td> <td class="xl69"> Mr Mark K</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl67" style="height: 12.75pt;" align="right" height="17">100419</td> <td class="xl70"> Hungry Minds
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl67" style="height: 12.75pt;" align="right" height="17">100419</td> <td class="xl70"> Hungry Minds
</td> </tr> </tbody></table>
When there is a change in the account number i want the the row to be coloured differently. Eg row 1 and 2 would be coloured blue, row 3 would be coloured green, row 4 and 5 coloured blue, row 6 will be green...etc

Appreciate an assistance with this
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Hi,

Do you mean like this?....


Excel Workbook
AB
1Account NumberCustomer Name
2100241Mr Smith
3100241Mr Richard
4100283Cuthbertson
5100302Varnor Pty Ltd
6100302Varnor Pty Ltd
7100334John & Thompson
8100372Mr Mark K
9100419Hungry Minds
10100419Hungry Minds
Sheet3


In 2007, Highlight the range from A2:B10, Go to Conditional Formatting, New Rule, Use a formula etc, and paste this into the box.... =Countif($A$2:$A$10,$A2)>1
Select the Format that you require (blue), click Ok, Ok, OK.
Whilst you have your range highlighted select the fill colour (green) from the Home tab, you should now have what you require.

I hope that helps.

Ak
 
Upvote 0

Forum statistics

Threads
1,224,609
Messages
6,179,879
Members
452,948
Latest member
Dupuhini

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