Position a user form next to selected cell

N

nowhereman

I have a macro which calls a user form

When the user form opens as the macro runs it is in the center of the
screen..... is it possible to cause it to be positioned next to the
selected cell.

I see a "manual" choice in the form properties, I am not brilliant enough
to figure how to make that setting work manually, much less with code.

TIA for any help you have time to offer

NWM
 
J

Joel

This code should work. You may want to add a little to the Left Position to
move it away from the cell


LeftPos = ActiveSheet.ActiveCell.Left
Wdth = ActiveSheet.ActiveCell.Width
TopPos = ActiveSheet.ActiveCell.Top

UserForm1.Left = LeftPos + Wdth
UserForm1.Top = TopPos

Userform1.show
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top