Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Variable in one sub which refers to an input box in another sub.

Public Var1
Public Var2

Sub Master()
var1 = Inputbox("enter value for var1")
var2 = InputBox("Enter value for var2")
ABC
EFG
End Sub

Sub ABC()
msgbox "Value of var1 is " & var1
End Sub

Sub EFG()
msgbox "Value of var2 is " & var2
End Sub

Another way is to pass the value of the variable to the sub in the argument
list.

--
Regards,
Tom Ogilvy


"Aaron" wrote:

I have a sub that runs 17 other subs. It takes about a half hour to
complete. Throughout the 30 minutes various input boxes pop up. I want to
define all the variables through input boxes as the very first step so I can
walk away and I don't have to wait for each box to pop up as the program
runs. But that means having my variable is one sub and my variable
definition in another sub. This does not seem to work. How can I get a
defined variable to look into another sub for its meaning?

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
Need variable that refers to same row different column Toddomation Excel Discussion (Misc queries) 3 January 18th 10 05:50 PM
Variable sum from defined input David Excel Worksheet Functions 7 March 10th 09 06:26 AM
Formulas containing variable input ym4life Excel Discussion (Misc queries) 5 August 16th 05 01:07 PM
variable/Input box problem [email protected] Excel Programming 2 April 13th 05 01:31 PM
Input box with variable buggy Excel Programming 2 November 19th 04 03:11 PM


All times are GMT +1. The time now is 10:17 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"