Passing Data between userforms

jameslytle

New Member
Joined
Jul 30, 2018
Messages
21
I am having issues passing information between userforms and I have tried asking how to do this here but I think I was asking the wrong questions.

Here is my quandry. I have numerous UserForms that utilize data created on another UserForm but I can't seem to get it to recognize the data so I can use it.

Sample.

UserForm1
ERAText=1

UserForm2
Select Case ERAText
Case 1
Do task
Case 2
Do Task
End Select

UserForm1 creates the initial value of ERAText that I need to transfer to UserForm2 to use in the "Select Case" function.

How do I set the UserForms up to be able to properly pass this data back and forth?

Thanks in advance.

Jim
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Declare ERAText as a public variable in a standard code module e.g. Module1. That makes its scope global and available to all procedures.

So put this at the very top of Module1 and do not declare it in other procedures. Just use it.

Code:
Public ERAText As Long
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,592
Messages
6,120,433
Members
448,961
Latest member
nzskater

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