Positioning a userform properly
Posted on 2011-09-02
I understand that a userform's .left and .top properties are numbers that relate to the current screen.
I have a userform that I need to popup to the right of a button I have on my sheet. The button is positioned at Range("AY1").Left - 10.
Since Range().Left is a distance from column A to whatever range I'm specifying, I can't use that to position my userform. For me, Range("AY1").Left is 2548.5. My screen (Application.Width) is 972.
I'm not sure how I go about setting my startup position of my userform to where I want it to be (which is basically at ".Left of my button + .width of my button + 5" or something close to that).
I know I _could_ do Range("AY1").Left - Range("AL1").Left, but there's no guarantee that for someone else, the left-most column of the current window will be AL. I feel like I need to somehow find out where on my current window Range("AY1").Left is...
I hope I'm not completely overthinking this and am missing something obvious, though that's always possible. :)
Thanks in advance as always.