I can't make the damned macro starts on I change cell A1 on Sheet "Calendar" please help
Posted by Ada on June 09, 2000 6:49 AM
I can not make the following macro make run when I change the date in A1. I have more sheets in workbook, one is called "Calendar". On this one I want to run a macro called "Calendar", but only after I change the date in A1. I tried to use in Auto_Open the code Application.OnEntry="Calendar" but it did not work. When I tried another code (forgot it) the macro run even when I change cells in other sheets. Please help.
Sub auto_open()
Application.OnEntry = "Calendar"
End Sub
Sub Calendar()
'
' Macro recorded 05/10/2000
'
For Each C In Range("b7:au7")
C.Offset(1, 0).Font.Bold = True 'RESET 01,02,03 offset(1,0)=range(b8:au8)unbold cells days # (ex. 01,02)
C.Offset(1, 0).Font.ColorIndex = 0 'reset to no color fonts in cells that have days # (ex. 01,02)
With C.Offset(1, 0).Interior 'yellow in 1,2,3... cells
.ColorIndex = 6
.Pattern = xlSolid
End With
C.Interior.ColorIndex = xlNone 'RESET MON,TUE,WED range(b7:au7) no color in cells that have days name (ex. Mon,Tue)
C.Font.Bold = False 'unbold cells that have days name (ex. Mon,Tue...)
C.Font.ColorIndex = 0 'font color set to automatic (blue)
If C.Value = 1 Then 'IF is SUN
With C.Offset(1, 0).Interior '1,2,3 fill days cells (Sundays) (ex. 1,2) with color (blue)
.ColorIndex = 8
.Pattern = xlSolid
End With
With C.Interior 'Mon,Tue,Wed fill days cells (Sundays) (ex.Sun)with color (blue)
.ColorIndex = 8
.Pattern = xlSolid
End With
C.Font.Bold=Tr