Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Text box results to become a Variable

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Text box results to become a Variable

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Text box results to become a Variable

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Text box results to become a Variable

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
provide simultaneous results for a range of a particular variable [email protected] Excel Discussion (Misc queries) 2 December 29th 06 01:14 AM
Within VB, how to pass results of a FormulaArray to a variable. Tim Excel Programming 1 March 26th 06 11:58 PM
Define drop-down results that are variable and dependent upon the. 33zenlane Excel Discussion (Misc queries) 4 December 13th 05 09:42 PM
get subtotals results as a variable Przemek Wrzesiński Excel Programming 4 August 7th 05 08:42 PM
Variable results to new workbook Fred[_20_] Excel Programming 1 October 7th 04 02:39 AM


All times are GMT +1. The time now is 12:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"