Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Passing Public Variable into Sheet Sub Functions
Hey all,
Let me preface this by stating that I am not a programmer and know just enough to be dangerous. I have been writing various subfunctions within each sheet of a XL workbook. I have a line of code to get the folder path because although the file names I am using from month to month will remain the same the folder path will change. Each time I click on a control button on the XL sheet: Private Sub CommandButton1_Click() this line is run: strPath = InputBox(prompt:="Enter Entire Path for Folder Location!") What do I need to do so that I run this only once (say on the first sheet) and this variable is then passed to all the other sheets as I run them? My thought was to put this in a module: Public strPath As String Sub Get_Folder strPath = InputBox(prompt:="Enter Entire Path for Folder Location!") End Sub How do I then pass this to a sheet subfunction? Sub Sheet1_Run() End Sub Thanks in advance, Lance |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
passing a variable from sheet to form to another sheet | Excel Programming | |||
public function having array passing out to a sub dropdown | Excel Programming | |||
Passing Variable from Sheet to Userform | Excel Programming | |||
Use of public variables vs. passing arguments | Excel Programming | |||
Passing Public Module Vairable to a Worksheet Event | Excel Programming |