
This code is set up for the example shown at the top of this article. If Cells(r, c).Interior.ColorIndex 2 And Cells(r, c).Interior.ColorIndex -4142 ThenĬells(r, c) = Cells(2, c).Value 'the "2" number is the row which contains the date information

Hlimit = Cells(2, Columns.Count).End(xlToLeft).Column ' count down to the Date bar - tells Excel to count how many columns there areįor r = 3 To vlimit 'set R to be the first Row which contains dataįor c = 4 To hlimit 'set C to be the first column that contains dates Vlimit = Cells(Rows.Count, 1).End(xlUp).Row 'count across to the column containing the tasks - tells Excel to count how many rows of data Print out the contents of a cell which you want to ignore, count how many Rows and then Coloums the cell is at and enter in r,c formatĭebug.Print "value = " & Cells(2, 9).Valueĭebug.Print "colour = " & Cells(2, 9).Interior.ColorIndex Sub Dates_from_colours_not_grey() ' return date values into cell if the cell is not a grey colour (colour index = 2) Into this area, copy the code below, from Sub to End Sub inclusive.

Excel will display a blank white space to the right. Select your file from the list on the left (if it isn’t already selected) and click on the Insert Menu and choose “module”. Bring up the VBA Window by pressing the and keys.
