VBA colour cells based on month

Lonemascot

New Member
Joined
Apr 28, 2015
Messages
14
Hi everyone. I have a table on a sheet that I want to apply to some formatting to.

RULE 1
where the B column (or table heading = "VAT quarter") has my VAT quarter end dates in. I want to fill the cell colour based on the month of these in the following way:
January = Orange fill
April = Yellow fill
July = Blue fill
October = Green fill

RULE 2:
Yellow fill to all blank cells in columns E8:O (table heading = "Date" through to "Phase allocation")

RULE 3:
Red fill in column X (table heading = "verified") if value equal to "-"

RULE 4:
Red font in column S, U and V if <0 (table heading = "Total", "NET" and "VAT")

RULE 5:
red font in column B and J if duplicate with anything else in same column (table ehading = "absolute" and "unique")

In an ideal world I'd like this macro to run after any update to the sheet but if this causes a bit of a slow down (there are thousands of rows) I suppose it could run every 5 mins or so.

In the past I have used conditional formatting rules but end up with hundreds of rules being created when rows are inserted/copied etc and it gets in a bit of a mess hence why i wanted the VBA route.

Thank you for any help you can provide.
 
Last edited:

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

Forum statistics

Threads
1,223,785
Messages
6,174,539
Members
452,571
Latest member
MarExcelTips

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