Biedubbeljoe
Active Member
- Joined
- Aug 16, 2004
- Messages
- 308
Hello,
Can someone tell me how to switch the calendar control ON and OFF by a button on my worksheet?
The calendar control:
---------------------------------------------------------------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Not Application.Intersect(Range("G10:G400,H10:H400,I10:I400,J10:J400,K10:K400,L10:L400,M10:M400,N10:N400,O10:O400,P10:P400,Q10:Q400,R10:R400"), Target) Is Nothing Then
Calendar1.Left = Target.Left + Target.Width - Calendar1.Width
Calendar1.Top = Target.Top + Target.Height
Calendar1.Visible = True
Calendar1.GridFontColor = RGB(0, 0, 0)
Calendar1.BackColor = RGB(255, 255, 255)
Calendar1.DayFontColor = RGB(0, 0, 0)
Calendar1.TitleFontColor = RGB(0, 0, 0)
Calendar1.Value = Date
Else: Calendar1.Visible = False
End If
End Sub
-------------------------------------------------------------
Can someone tell me how to switch the calendar control ON and OFF by a button on my worksheet?
The calendar control:
---------------------------------------------------------------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Not Application.Intersect(Range("G10:G400,H10:H400,I10:I400,J10:J400,K10:K400,L10:L400,M10:M400,N10:N400,O10:O400,P10:P400,Q10:Q400,R10:R400"), Target) Is Nothing Then
Calendar1.Left = Target.Left + Target.Width - Calendar1.Width
Calendar1.Top = Target.Top + Target.Height
Calendar1.Visible = True
Calendar1.GridFontColor = RGB(0, 0, 0)
Calendar1.BackColor = RGB(255, 255, 255)
Calendar1.DayFontColor = RGB(0, 0, 0)
Calendar1.TitleFontColor = RGB(0, 0, 0)
Calendar1.Value = Date
Else: Calendar1.Visible = False
End If
End Sub
-------------------------------------------------------------