Store forms input into variable

Shiro26

Board Regular
Joined
Oct 2, 2015
Messages
82
Hi,

I have a code which is activated by a button click.
After several seconds of run, I show a form containing two textboxes named TB1 and TB2.

How can I store the values that the user enters in TB1 and TB2 into two variables named respectively TB1val and TB2val for example, after clicking an 'OK' button on the form?
Clicking the 'OK' button would also close the form and resume my code with my variables filled

I would like these parameters to remainstored until the end of the macro run
I know how to do that when there is only one value using an inputbox but with more, how can I do that?

thank you for your help.

Best,

Shiro
 
Hi Phil

Thank you for taking the time to reply.
I am going to try your solution and come back it I still face some issues.
Thank you very much,

Kind Regards,

Shiro
 
Upvote 0

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

Forum statistics

Threads
1,216,226
Messages
6,129,606
Members
449,520
Latest member
TBFrieds

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