R
riccifs
Hi to everyone,
I'm using this code to add dates in a rage of cells. It uses a
calendar control to fill in dates.
I found it to this web-site: http://www.rondebruin.nl/calendar.htm
It's working well but the only problem is that:
When the calendar pops up it shrinks its size every time I try to open
the workbook.
I mean, I chose its size, of course, I save the excel file and when I
reopen it, the calendar control form have a smaller size with respect
to the one I set up previously!
What I am missing to do? May be I just doing something stupid but I
can't go out from this clue!
Hope someone will help me!
Bye,
Stefano.
***start code***
Private Sub Calendar1_Click()
ActiveCell.Value = Calendar1.Value
'ActiveCell.NumberFormat = "dd/mm/yyyy"
ActiveCell.Select
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Not Application.Intersect(Range("D271"), Target) Is Nothing
Then
Calendar1.Left = Target.Left + Target.Width - Calendar1.Width
Calendar1.Top = Target.Top + Target.Height
Calendar1.Visible = True
' select Today's date in the Calendar
'Calendar1.Value = Date
If Not IsDate(Target.Value) Then
Calendar1.Value = Date
Else
Calendar1.Value = Target.Value
End If
ElseIf Calendar1.Visible Then Calendar1.Visible = False
End If
End Sub
***end code***
I'm using this code to add dates in a rage of cells. It uses a
calendar control to fill in dates.
I found it to this web-site: http://www.rondebruin.nl/calendar.htm
It's working well but the only problem is that:
When the calendar pops up it shrinks its size every time I try to open
the workbook.
I mean, I chose its size, of course, I save the excel file and when I
reopen it, the calendar control form have a smaller size with respect
to the one I set up previously!
What I am missing to do? May be I just doing something stupid but I
can't go out from this clue!
Hope someone will help me!
Bye,
Stefano.
***start code***
Private Sub Calendar1_Click()
ActiveCell.Value = Calendar1.Value
'ActiveCell.NumberFormat = "dd/mm/yyyy"
ActiveCell.Select
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Not Application.Intersect(Range("D271"), Target) Is Nothing
Then
Calendar1.Left = Target.Left + Target.Width - Calendar1.Width
Calendar1.Top = Target.Top + Target.Height
Calendar1.Visible = True
' select Today's date in the Calendar
'Calendar1.Value = Date
If Not IsDate(Target.Value) Then
Calendar1.Value = Date
Else
Calendar1.Value = Target.Value
End If
ElseIf Calendar1.Visible Then Calendar1.Visible = False
End If
End Sub
***end code***