Conditionnal formatting using macro

Closed
Nikita - Mar 14, 2011 at 05:36 PM
 Niki - Apr 13, 2011 at 01:20 PM
Hello,

I am trying to create a calendar in excel in which certain days shoulded be marked with a colour.
In my excel file, one day is one column and on each row there is a certain time interval that indicates which days on that line should get a colour. (each row has a different time interval)

In order to automate the formatting I should be able to write the following condition in VBA but I don't know how to...

AND(AY$12>=$AB14;AY$12<$AB14+($AC14-$AB14+1)*$AI14%)

For each cell, the macro should first record the date which is mentionned on row number 12 in each column.
And then the macro should check whether the date is in the interval and if yes, the cell should get a certain colour...

Could someone please help me on this matter?

Thanks in advance.

Niki

2 replies

RWomanizer Posts 365 Registration date Monday February 7, 2011 Status Contributor Last seen September 30, 2013 120
Mar 15, 2011 at 01:42 AM
Could you please upload a sample EXCEL file WITH sample data, macro, formula , conditional formatting etc on some shared site like https://authentification.site , http://docs.google.com, http://wikisend.com/ , http://www.editgrid.com etc
AND post back here the link to allow better understanding of how it is now and how you foresee. Based on the sample book, could you re-explain your problem too.


Note: your data need not be to be real data but a good representative of how data looks like

Rahul
0
Hi,
Here's the link where you can find my file: http://www.speedyshare.com/files/27948324/Onderhoud.xls

There is a conditionnal formatting applied in the file which gives the green colour in cel AY14-BC14 derived from the time interval between AB14 and AC14.

Since I want to add extra time intervals per row, so that on one row I can have multiple coloured cells, I need to put my conditionnal formatting in VBA.

Hope this is a bit clear, thanks a lot for the help!

Regards,

Niki
0