Here is the code that is in the worksheet that makes the calendar smaller:
Private Sub Calendar1_Click()
ActiveCell.Value = CDbl(Calendar1.Value)
ActiveCell.NumberFormat = "ddd mm/dd"
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("A5:A1520"), 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
ElseIf Calendar1.Visible Then Calendar1.Visible = False
End If
End Sub
On several other worksheets this code works fine and has been for a couple
of years.
Here is the code from the worksheet that makes the calendar bigger:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Not Application.Intersect(Range("D4:D500,J4:J500,M4:M500"), 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
ElseIf Calendar1.Visible Then Calendar1.Visible = False
End If
Application.EnableEvents = False
On Error GoTo sub_exit
If Not Intersect(Target, Range("Checks")) Is Nothing Then
With Target
If .Value = "P" Then
.Value = ""
Else
.Value = "P"
.Font.Name = "Wingdings 2"
End If
End With
End If
sub_exit:
Application.EnableEvents = True
End Sub
Private Sub Calendar1_Click()
ActiveCell.Value = CDbl(Calendar1.Value)
ActiveCell.NumberFormat = "ddd mmm dd"
ActiveCell.Select
End Sub
This code is particular to this one worksheet because I needed the
checkmarks and combined the two macros (cobbled as it may be it does the job).
Any help/direction would be appreciated
Mike Rogers
--
p45cal
*p45cal*
------------------------------------------------------------------------
p45cal's Profile: http://www.thecodecage.com/forumz/member.php?userid=558
View this thread: http://www.thecodecage.com/forumz/showthread.php?t=156759
[url="http://www.thecodecage.com"]Microsoft Office Help[/url]
Is your Zoom different in that workbook
Sometimes if that is true this will help
Deltee the control
Save the file
Add the control
Save the file
--
Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm
"Mike Rogers" <Mike060349@NoxSpamxAOLDOTcom> wrote in message news:37B5C6CE-0796-4427...@microsoft.com...
Ron
Did the Delete code & control>Save>Close>Reopen>Added code and control and
it still has the problem. Here is what I found. Upon placing the control
its properties said it was 138.75 x 307.5. Saved>closed>reopened 5 times.
After the fifth time the control properties said it was now 425.75 X 930.75.
Did not try the other worksheet because it gets smaller (whereas this one
gets larger) at a much slower rate & it is easier to live with. Zoom was
125% each time I opened/closed and remains the same now. Is it possible to
add code to keep the control about the 138.75 X 307.75 size?
Thanks for your time
Mike Rogers
"Ron de Bruin" wrote:
> .
>
The zoom is the same on both, but I will try your suggestion and post back.
I was thinking about addiing the necessary code to have the control be the
same size upon opening......
I'll give it a try and post back, Thanks
Mike Rogers
"Ron de Bruin" wrote:
> .
>