fetchboi88
New Member
- Joined
- Mar 9, 2009
- Messages
- 4
I have a command button in cell A1, with the first row of the sheet frozen. When you click the command button, I'd like a calendar to be displayed under it. My problem is, however, that when the calendar is shown, it's only shown on cell A2, so if the user has scrolled down to row 100, you cannot see the calendar.
Is there a way to get the calendar to be shown under the first row no matter where the user has scrolled to?
Here's the non-working code i have now:
Is there a way to get the calendar to be shown under the first row no matter where the user has scrolled to?
Here's the non-working code i have now:
Code:
Private Sub cmdGoTo_Click()
If Calendar1.Visible = False Then
'i think the first row that is visible needs to be determined before this
Calendar1.Top = Range("A1").Rows.Top + Range("A1").Rows.Height
Calendar1.Left = cmdGoTo.Left + cmdGoTo.Width
Calendar1.Height = 179.25
Calendar1.Width = 274.5
Calendar1.Visible = True
Else
Calendar1.Visible = False
End If
End Sub