Calendar default date

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

--
Message posted from http://www.ExcelForum.com

0
2/12/2004 2:37:13 AM
excel.misc 78881 articles. 5 followers. Follow

2 Replies
359 Views

Similar Articles

[PageSpeed] 33

Try this

Private Sub UserForm_Initialize(
     If IsDate(Selection.Value) The
            Calendar1.Value = DateValue(Selection.Value
      Els
            Calendar1.Value = Int(date
            Selection.NumberFormat = "mm/dd/yy
      End I
End Sub
0
anonymous (74722)
2/12/2004 1:46:08 PM
This is in a worksheet that I am trying to make this work with. It look
like this is for a userform? 
I tried a few different thing with the code you wrote but couldnt ge
it to work. Also, I was assuming I should just put that in with th
code I posted in the first post correct

--
Message posted from http://www.ExcelForum.com

0
2/13/2004 5:41:17 PM
Reply:

Similar Artilces: