Calendar keeps reducing size

  • Thread starter Thread starter RobN
  • Start date Start date
R

RobN

I have a Calendar control for which I've set various size and position
numbers. Each time I save the file, close and reopen, it reduces in size
until, finally I can't even read the numbers. I then need to stretch the
calendar back to a proper size.
Is there a property I need to set? What does the Placement property do?

Rob
 
Thanks Mark. I'll check that out a bit more, but it seems that the info
there-in just incorporates some extra code to set the parameters of size,
placement, etc., which is fine, but why is this problem ocurring? Any idea?

Rob
 
Almost forgot...

I made a few changes to what "johnske" had on his entry.

On the userform code:

'*********CODE FOR USERFORM MODULE**********

Option Explicit

Private Sub MonthView1_DateClick(ByVal DateClicked As Date)
'format date another way if you want to change
Selection = Format(MonthView1, "dd mmm yy")
Unload Me 'added to unload the calendar after selection is made
End Sub

Private Sub UserForm_Activate()
'this sets all the sizes + calendar position
With UserForm1
.Caption = "Select a Cell, Then a Date"
.Height = 145
.Width = 142
.Left = 100 'added for ease of selection
.Top = 200 'added for ease of selection
End With
With MonthView1
.Height = 120
.Width = 130
.Left = 4
.Top = 4
End With
DoEvents
End Sub
'********************************************



Then on each worksheet you need a calendar on, add the following code to
that SHEET:


'********CODE FOR SHEET(S)*********
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Not Application.Intersect(Range("A1:A20"), Target) Is Nothing Then
UserForm1.Show
End If
End Sub
'********************************************
 
I think it has something to do with the type of calendar control you are
using...

Give this one a shot...


Mark
 
Yes, that works fine although it seems a clumsy/longwinded way to make it
happen. I'm also a bit disappointed that it's not a clean calendar, as the
UserForm title, etc. can't be hidden.

But thanks, it's an alternative if I don't want to continue stretching the
calendar to the correct size every so often.

Rob
 
Back
Top