I am trying to create a conditional formatting rule in VBA that will change the cell background color only for the current date. I have a column of dates for the year. I am also using Office Excel 2010.
oSheet.Range(Cells(iStartRow, 1), Cells(iLastRow, 1)).FormatConditions.Add xlCellValue, xlEqual, "=" & Cells.Address & "=" & Date
I am trying to identify the current cell's address, so that it can be compared against today's date. Remember that this formula will be checked against a column of different dates.
I can create the conditional formatting in Excel easy enough, but I'm trying to recreate this statement in VBA code.
When I create the Conditional formatting necessary for the Dates Occurring in Excel and then view the formula in VBA; here are the results:
=FLOOR(A32,1)=TODAY()