Converting Conditional Formating into VBA Code

CDNWolf

Board Regular
Joined
Nov 14, 2010
Messages
71
Office Version
  1. 365
Platform
  1. Windows
Hi guys,


I'm looking to change from Conditional Formatting to VBA Code... I am fairly new to VBA so any assistance would be appreciated.


The spreadsheet I am using has a START and END date. For example L10 = 01/01/2015 and M10 = 01/04/2015. Each row has a different date, etc

The RANGE I am using to format (Backgroung Colour / Fill) is $N$10 - $MK$5011. Each of these cells is filled with a fixed date ranging from 01/01/2014 - 31/12/2020. The dates are hidden using a text colour of white so they are not visible...


The Conditional Formatting I am using states if N10 is between L10 and M10 then fill with RED.
Example L10 = 01/01/2015, M10 = 01/04/2015, N10 = 01/01/2015, therefore N10 should be Coloured RED as it is within the range of 01/01/2015 and 01/04/2015...


In addition I want to also check the date against G10 and H10 and fill it GREEN and finally checking again I10 and K10 and filling with YELLOW.


The Conditional Formatting is working well as a visual aid but I can not count the filled cells and create charts / Graphs, etc...


Thanks in advance for your advice.
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Thanks VoG but that link is very confusing and a lot of programming, not sure if I understand it...
 
Upvote 0

Forum statistics

Threads
1,214,386
Messages
6,119,214
Members
448,874
Latest member
b1step2far

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