UserForm positioning just below the specified cell

hrayani

Well-known Member
Joined
Jul 23, 2010
Messages
1,501
Office Version
  1. 2016
Platform
  1. Windows
Hello Friends,

I want the position of the userform to be as follows

1) Top position > Just below Cell C1
2) Left Position > Just next to Cell B2

As of now I am using this below code but the position get shaken when the screen is zoom out or zoom in

VBA Code:
Private Sub UserForm_Initialize()
With Me
    .StartUpPosition = 0
    .Top = Range("C1").Top + 170
    .Left = Range("B2").Left + 50
End With
End Sub

Any help would be appreciated

Regards,

Humayun
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Hi Dave,

I downloaded the file... There is a lot of stuff out there. Will take some time to test that out...

What I have done now is I have set the position of the userform with screen zoom 100 % and before calling the userform I have set the zoom level to 100%.

Thanks for the reply,

Regards,

Humayun
 
Upvote 0
Hi Dave,

I tested the file to the best of my understanding but unable to make it work.

The user form changes its position when the screen zoom level changes - thus does not stick to cell.

Any idea ??

I want the userform to stick to a cell no matter what the screen size is or headings are displayed or not or its a full screen or not....
 
Last edited:
Upvote 0
Sorry not my code or one I have used - unless another is familiar with it, suggest you contact the author on his site.

Dave
 
Upvote 0
Thanks anyways dave

I will wait for the experts out here. Hopefully I will get a solution to it
 
Upvote 0

Forum statistics

Threads
1,215,472
Messages
6,125,011
Members
449,204
Latest member
tungnmqn90

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top