hi all,
I'm sure this is really easy but I am not a VBA expert.
Basically what I want to do is starting from a set cell I want to move the next column and colour that cell. And do this under condition in a for loop.
(what I am trying to do is make a Gantt chart)
I know how to set the colour in the cell, and I can move down cells in a range but not across columns.
An example of this would be.
I have set-up my excel spreadsheet with years going horizontally across the top. Say starting with 2003 and going on to 2050 with each column being a year.
On another worksheet I put in a start and finish date of 2005 and 2010 respectively.
I want to then colour all the cells 2005 to 2010 yellow.
I would start at the 2003 cell and check if the cell is between the two values 2005 and 2010 and if it is colour it yellow. Then move to the next column and do the check again, carrying on until I have been through all the dates.
I know I can use conditional formatting in excel but that only allows me 3 conditions and over time I will want many more than that.
Can anybody help me out please.
Thanks very much
Goatboy
I'm sure this is really easy but I am not a VBA expert.
Basically what I want to do is starting from a set cell I want to move the next column and colour that cell. And do this under condition in a for loop.
(what I am trying to do is make a Gantt chart)
I know how to set the colour in the cell, and I can move down cells in a range but not across columns.
An example of this would be.
I have set-up my excel spreadsheet with years going horizontally across the top. Say starting with 2003 and going on to 2050 with each column being a year.
On another worksheet I put in a start and finish date of 2005 and 2010 respectively.
I want to then colour all the cells 2005 to 2010 yellow.
I would start at the 2003 cell and check if the cell is between the two values 2005 and 2010 and if it is colour it yellow. Then move to the next column and do the check again, carrying on until I have been through all the dates.
I know I can use conditional formatting in excel but that only allows me 3 conditions and over time I will want many more than that.
Can anybody help me out please.
Thanks very much