ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Userform and variable (https://www.excelbanter.com/excel-discussion-misc-queries/135161-userform-variable.html)

Jeff

Userform and variable
 
Hi,

I have a userform, and you enter a number. Then based on the input the
userform runs code that uses the number. Usually I have the input box, where
the number is input, linked to the worksheet, then the code references the
worksheet

x = Sheets("Sheet1").range("a1").value

then it does the code, but is their a direct way to set variables using the
input in the userform.



Bernie Deitrick

Userform and variable
 
Jeff,

It depends on the control, but something like

Variable = UserformName.ControlName.Value

..Value might be .Text, etc. depending on the control

HTH,
Bernie
MS Excel MVP


"Jeff" wrote in message
...
Hi,

I have a userform, and you enter a number. Then based on the input the
userform runs code that uses the number. Usually I have the input box, where
the number is input, linked to the worksheet, then the code references the
worksheet

x = Sheets("Sheet1").range("a1").value

then it does the code, but is their a direct way to set variables using the
input in the userform.






All times are GMT +1. The time now is 08:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com