Stop my VBA Userform objects from moving when switching screens

markgrnh

New Member
Joined
Apr 7, 2023
Messages
18
Office Version
  1. 365
Platform
  1. Windows
Good afternoon,

I am secretly hoping there is a quick easy fix to my issue, but I suspect I am wishful thinking.
I have a VBA Userform that uses a multipage and I use it like a standalone program, with different pages doing certain things.
Now the issue I have is on certain pages, I have used a picture as the backdrop so some pages look more professional than the standard functions in VBA and then place my VBA labels, drop down menus, text boxes etc exactly where I need them. When they are all lined up they look amazing, but if I then switch to look at the form on my laptop screen all the objects (label, drop down menus etc) all move.

So what I want to know, is it possible that these can be somehow made static in their positioning with the picture background regardless of the monitor/screen being used to view the form or a way to set it up so everything is lined up again if the screen resolution changes? I understand there is a way for VBA to look at the resolution from Windows but I have no idea on how to use that information to automatically resize, reposition everything if the next screen is different to the original.

I have attached a screenshot of what I mean, last night on my laptop I arranged the picture and the objects perfectly, yet when I opened the same sheet using my monitor I got the result shown in the attached. The picture is cropped, eg, some not being shown properly and all my objects are not where I want them.

My VBA knowledge isnt great but I am learning, but this is way beyond any ideas I have to fix it.

Just for reference if its applicable but the background picture properties are as follows:

1682608518416.png

I havent tinkered with the AutoSize to True though, if that would actually help?
Can anyone help or suggest anything I can try?

Thanks

Mark
 

Attachments

  • Jumbled mess.JPG
    Jumbled mess.JPG
    91.3 KB · Views: 24

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
You're saying the issue is because of different monitor resolutions, or that on the same monitor, everything looks ok in design view but not form view? I know that form resizing can be done in Access so if you get no help here you could check that out. I've never done it so can only provide a link for Access. Maybe you could adapt. If you do, please provide your code to the original author.
 
Upvote 0
Hi Micron,
They look different when you view the form on a different monitor or computer. Design and then form view are both the same.
 
Upvote 0

Forum statistics

Threads
1,214,827
Messages
6,121,823
Members
449,049
Latest member
cybersurfer5000

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