Userform and variable

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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
 
Back
Top