UserForm StartUpPosition
Question
I have made a nice calendar pop up in excel and tested the UserForm position with:
.Top = Application.Top + 125
.Left = Application.Left + 125
This works great however what I truly would like is to have the form pop up right next to the active cell.
What I have tried below is not working and I am not sure why. I want the top left corner of the form to touch the top right of the active cell, however the form ends up covering the active cell
.Top = ActiveCell.Top
.Left = ActiveCell.Left + ActiveCell.Width
Any Suggestions?
Solution
This is working for me as you expect:
.Top = ActiveCell.Top + ActiveCell.Height / 2 + .Height
.Left = ActiveCell.Left + ActiveCell.Width * 1.5
OTHER TIPS
If Application.Version = "11.0" Then
Me.Top = Application.Top + [b7].Top + 70 - Windows(1).VisibleRange.Top
Else
Me.Top = Application.Top + [b7].Top - 4 + (Application.CommandBars.Item("Ribbon").Height * 0.75) - Windows(1).VisibleRange.Top
End If
Me.Left = Application.Left + [b7].Left + 90 - Windows(1).VisibleRange.Left
is not too bad...
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow