UserForm Help

cboyce44

New Member
Joined
Oct 3, 2023
Messages
42
Office Version
  1. 365
Platform
  1. Windows
I have 5 data entry userforms in an excel sheet. I have the first UserForm labeled "CalibrationMainForm" that has a Save button that opens up another form. On this form are 2 Option Buttons labeled "OptButtonCalAF" and "OptButtonCalAL". As seen below:
1734379849161.png

At the end of the 3rd UserForm "ArtifactNom" there is another "Save" button. When the operator presses "Save" on this particular form, I would like either the AFRoughnessResults UserForm to open if user had selected "As Found" option button from CalibrationMainForm or open ALRoughnessResults UserFrom if user had selected "As Left" option button from CalibrationMainForm.

Here is a list of the UserForms I have:

1734380078877.png


Thank you for all of your help.
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
When the operator presses "Save"

Try:


If you have not closed the userform CalibrationMainForm then, in save button

VBA Code:
if CalibrationMainForm.OptButtonCalAF = true then
  AFRoughnessResults.show
elseif CalibrationMainForm.OptButtonCalAL = true then
  ALRoughnessResults.show
end if
 
Upvote 0
What if I do have "CalibrationMainForm" closed already?

The values in the userform controls are in memory while the userform is open, when you close the userform, with the unload statement, then the memory is cleared and the values are lost, in this case you would not know which option button was selected.
If you still want to close the userform, then when you close it you must pass the values to a cell, to later recover those values from the cells, but this is more complicated.
🧙‍♂️
 
Upvote 0

Forum statistics

Threads
1,224,750
Messages
6,180,740
Members
452,996
Latest member
nelsonsix66

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