Userform and variable

J

Jeff

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.
 
B

Bernie Deitrick

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top