mezr
Active Member
- Joined
- Feb 2, 2003
- Messages
- 301
Hi,
I started using this code to bring up a calendar control that would allow me to double click a date on the calendar and place that date in the active cell.
I've run into an unusual problem with it though. That is, I am using a freezepane set at cell C6, and frequently when the calendar pops up it won't respond. What I've noticed though is that when I turn off the freezepane, everything works fine.
Since the freezepane is necessary, are there any suggestions for how I can write this code differently, maybe how I can turn off the freezepane at the start of the code and have it reset to cell C6 at the end - without actually moving the screen to C6?
I started using this code to bring up a calendar control that would allow me to double click a date on the calendar and place that date in the active cell.
Code:
Private Sub Calendar1_DblClick()
ActiveCell.NumberFormat = "mm/dd/yy"
ActiveCell = Calendar1
Calendar1.Visible = False
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, [D6:D22,H6:H22]) Is Nothing 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
Since the freezepane is necessary, are there any suggestions for how I can write this code differently, maybe how I can turn off the freezepane at the start of the code and have it reset to cell C6 at the end - without actually moving the screen to C6?