Is it possible to scale a userform based on monitor size?

Mr_Ragweed2

Board Regular
Joined
Nov 11, 2022
Messages
145
Office Version
  1. 365
Platform
  1. Windows
Theoretical question i guess. I am constructing a userform for a sales team team to use. Most of the work was done at my office on a "typical" monitor size (21 or 23 inch i think). I took my lap top home to work on it some some more and when i call the form i can only view roughly the top half to two-thirds if it and cannot "drag it up" to see the bottom. Since there will be multiple users i would like to try and fix this issue before i release it.
If i can't resize it, can i make it draggable? There's a chance it could be used on ipad as well, but i'm mainly concerned about laptop screens. (Dell Latitude 5940). whatever the solution, if any, is it possible to put it in the vba code - possibly on the userform call?
Thanks in advance.
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
I resized the userform manually in the developer to a size that works across all environments (not tested on ipad).
Still curious though on having userforms adapt to display settings though.
 
Upvote 0
You can use code to tell when the bottom of the form is not visible
VBA Code:
   If UserForm1.Top + UserForm1.Height > Application.Top + Application.Height Then
       MsgBox "Bottom of form is not visible"
   End If
(this example assumes that the excel window is maximized)

If laptop screen use was the exception, my approach would be to have two forms. One for normal use on a larger monitor, another for use on small laptop monitors.
 
Upvote 0
Solution
rlv01 Thank you very much. So it would kinda be like a mobile app vs a desktop app (having two forms?). I like that.

"The frustration is part of he fun" - me, reminding myself why i try this VBA stuff
 
Upvote 0
You won't be able to use this at all on an iPad because mobile platforms can't run VBA.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

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