Colour cells through VBA

motilulla

Well-known Member
Joined
Feb 13, 2008
Messages
2,422
Office Version
  1. 2010
Hello,

I am looking VBA solution, which can fill the colours if lower line data match with upper line using alternate colourers

For example:
Row3 data match with row2 fill colour red and font white
Row4 data match with row3 fill colour green and font white

I am using conditional format formula =SI(C2=C3;1;0) for row 3 for CF red and white
I am using conditional format formula =SI(C3=C4;1;0) for row 4 for CF green and white and then copy this format to row down

But know I am getting message formatting will not save too much data so I cannot continue formatting more that 1800 rows

So please I need the VBA solution

Sample Data


Book1
BCDEFGHIJKL
1Za1Za1Za1Za1Za1Za1Za1Za1Za1
2A5Y5YAA55
35AYYY5AAY
45A55AAYYA
55A5YY5A55
6A5A5A55A5
7AAA5555A5
8YA555YAAA
9A5AA55555
105AA5Y5Y55
11AYA55A555
12555555AAA
135Y5YA55YA
145AA55YAA5
155AA55Y55Y
16555A5555A
17A5YA555YA
18555A5AA5A
1955555AAY5
20555555555
215YY555555
2255A555555
23AAA555A55
24AY55Y5555
255AYY555YA
26Y5AA55AA5
275A5YY5555
2855A5YYY55
29Y5A5A5A55
30A55555Y5Y
315Y55A555A
32A5555A5Y5
33
Sheet1


Thank you all
Excel 2000
Regards,
Moti
 
Last edited:
In your previous post you said:
"
this is exactly I was looking for, working as request prefect
"

So if the code I provided worked great. Did you now fine a problem with it now?
My Aswer Is This, your code is working flawless as I said there is not any problem and I am using it.

Thank you

Regards,
Moti
 
Upvote 0

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

Forum statistics

Threads
1,223,911
Messages
6,175,329
Members
452,635
Latest member
laura12345

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