C
clayton
Using excels calendar on a worksheet works great. However I would lik
it to default to todays date. I would think this would be the defaul
but I guess not.
I have inserted an Calendar 8.0 object.
I have inserted the following code in the worksheets code.
Private Sub Calendar1_Click()
'ActiveCell.NumberFormat = "m/d/yyyy"
ActiveCell = Calendar1.Value
Calendar1.Visible = False
Range("e27").Select
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 2 And Target.Row = 27 Then
Range("c27").activate
ActiveCell.Font.Size = 12
ActiveCell.Font.Bold = True
ElseIf Target.Column = 3 And Target.Row = 27 Then
Range("c27").activate
ActiveCell.Font.Size = 12
ActiveCell.Font.Bold = True
ElseIf Target.Column = 4 And Target.Row = 27 Then
Range("c27").activate
ActiveCell.Font.Size = 12
ActiveCell.Font.Bold = True
End If
If Not Application.Intersect(Range("b27:d27"), Target) Is Nothin
Then
Calendar1.Left = Target.Left + Target.Width - Calendar1.Width
Calendar1.Top = Target.Top + Target.Height
Calendar1.Visible = True
Else: Calendar1.Visible = False
End If
End Sub
It works great but just does not default to the current date...
Thanks for any help
it to default to todays date. I would think this would be the defaul
but I guess not.
I have inserted an Calendar 8.0 object.
I have inserted the following code in the worksheets code.
Private Sub Calendar1_Click()
'ActiveCell.NumberFormat = "m/d/yyyy"
ActiveCell = Calendar1.Value
Calendar1.Visible = False
Range("e27").Select
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 2 And Target.Row = 27 Then
Range("c27").activate
ActiveCell.Font.Size = 12
ActiveCell.Font.Bold = True
ElseIf Target.Column = 3 And Target.Row = 27 Then
Range("c27").activate
ActiveCell.Font.Size = 12
ActiveCell.Font.Bold = True
ElseIf Target.Column = 4 And Target.Row = 27 Then
Range("c27").activate
ActiveCell.Font.Size = 12
ActiveCell.Font.Bold = True
End If
If Not Application.Intersect(Range("b27:d27"), Target) Is Nothin
Then
Calendar1.Left = Target.Left + Target.Width - Calendar1.Width
Calendar1.Top = Target.Top + Target.Height
Calendar1.Visible = True
Else: Calendar1.Visible = False
End If
End Sub
It works great but just does not default to the current date...
Thanks for any help