Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'd like the input that is going to be entered by a user to become a variable
on my code when running the macro. How do I do that? Thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
One way is with the InputBox:
myVar = InputBox("Enter Something", "Create Variable") Or typeVar = Application.InputBox("Enter Something", "Create Variable", Type:=1) 'By setting a type in the Application.InputBox Methood, you can force it to be numeric entries (type 1), text entries (type 2) or formulas (type 0), to name a few. The InputBox function does not use a type designation and creates a variant variable. myVar or specVar becomes the variable equal to the value of the entry in the InputBox. "Lucia" wrote: I'd like the input that is going to be entered by a user to become a variable on my code when running the macro. How do I do that? Thanks |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sorry about that, I misread your posting.
myVar = TextBox1.Value 'If you have more than one textbox, you will need to identify the index number or name of the one you want to assign as a variable. "Lucia" wrote: I'd like the input that is going to be entered by a user to become a variable on my code when running the macro. How do I do that? Thanks |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks
"JLGWhiz" wrote: Sorry about that, I misread your posting. myVar = TextBox1.Value 'If you have more than one textbox, you will need to identify the index number or name of the one you want to assign as a variable. "Lucia" wrote: I'd like the input that is going to be entered by a user to become a variable on my code when running the macro. How do I do that? Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
provide simultaneous results for a range of a particular variable | Excel Discussion (Misc queries) | |||
Within VB, how to pass results of a FormulaArray to a variable. | Excel Programming | |||
Define drop-down results that are variable and dependent upon the. | Excel Discussion (Misc queries) | |||
get subtotals results as a variable | Excel Programming | |||
Variable results to new workbook | Excel Programming |