Locking CommandButton in UserForm in VBA

Shodi

Board Regular
Joined
May 24, 2016
Messages
53
Hi Everyone.
I am trying to write a VBA code where the UserForm resizes dynamically depending on values retrieved from cell counts.

I have worked that out but I need to have the CommandButton locked to the lower right-hand corner of the UserForm so that it can easily be clicked once the data input is over.

Since the UserForm resizes itself (it can become really big depending on the values captured) from a minimum of 1 textbox to possibly 15 columns and 50 rows of textboxes, I cannot have it anywhere in the top or bottom centre (please let me know if I am wrong and this is possible).

The most viable option I feel is to stick it in the lower right corner of the UserForm.

It is possible to have it in the upper left corner (it does remain stationary there) but that feels wrong...based on conventional structure.

Please let me know what can be done.

Thanks
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Hi,
An alternative idea is to fix the size of your Userform and put your textboxes into a Frame. Then add vertical scroll bars to the frame.

Link here for details of adding the scroll bars to a frame
 
Upvote 0

Forum statistics

Threads
1,223,952
Messages
6,175,595
Members
452,657
Latest member
giadungthienduyen

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