When I click in the designated range of cells, a UserForm of a MonthView opens. The basic script was provided in this SO thread. The UserForm is not placed in the desired location.
Here is the script that I used to open the UserForm whenever I clicked any cell in the B3:C2000 range in a certain worksheet.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Set oRange = Range("B3:C2000")
If Not Intersect(Target, oRange) Is Nothing Then
frmCalendar.Show
frmCalendar.Top = ActiveCell.Offset(0, 0).Top
frmCalendar.Left = ActiveCell.Offset(0, 1).Left
End If
End Sub
Question 1: I have the UserForm StartUpPosition property set to 0 - Manual - is this correct?
Question 2: When I click any cell in the specified range, for the first time after opening the workbook, the UserForm always opens in the far top left corner of the screen. Why?
Question 3: When I click any cell in the specified range, for any clicks after the first, the UserForm opens relative to the previous cell that was active, instead of the one I just clicked. How do I get it to open relative to the cell that just clicked, instead of relative to the previously active cell?
Question 4: Why does it appear to align the bottom of the UserForm instead of the top?