i have a calendar in Excel which continues until July 2020. What i would like to have in my worksheet is an automatic coloration of all cells of the "current month" every time i open the workbook.
I did already the "current day auto-coloration" This is the code :
Public Sub FormattaCalendario()
Dim LColCount As Long
Dim cell As Variant
ultimoGiorno = DateSerial(Year(Date), Month(Date), 0)
primoGiorno = ultimoGiorno - Day(ultimoGiorno) + 1
LColCount = Cells(TrovaInizioProgetti(activeCell) - 1,
Columns.Count).End(xlToLeft).Column
For Each cell In Range(Cells(TrovaInizioProgetti(activeCell) - 1, 11),
Cells(TrovaInizioProgetti(activeCell) - 1, LColCount))
If cell.Value = Date Then
cell.Interior.Color = RGB(255, 255, 91)
End If
If CDate(cell.Value) <> Date Then
cell.Interior.Color = RGB(255, 150, 0)
End If
Next
End Sub
Thank you in advance.