Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Passing variable from one sub to another
Can you just put a call into your other sub in the Workbook_BeforeClose sub?
Sub Workbook_BeforeClose() 'I don't remember what's in the () just leave as is Call SaveAsSub End sub To pass variables, it would have to be part of the declaration of the routine, and part of the call from the other routine. Sub PassAVariable() Dim t as integer t=4 Call PassedTheVariable(t) End Sub Sub PassedTheVariable(x as integer) 'doesn't have to be same name just same type y = x 'making y = 4 End sub "Matt" wrote in message ... I have a sub that displays a SaveAs dialog box that already has the default file location, name, and type in it. However, I would like to put the same code in the Workbook_BeforeClose sub so that they get the same dialog box as the other sub. I can't figure out how to get the Workbook sub to receive the filename(or any other variable for that matter) from the other sub. Or if you have any better ideas, that would be great. Thanks. Matt. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Passing Variable to LINEST | Excel Worksheet Functions | |||
Passing SQL Query Result Into A Variable | Excel Programming | |||
Passing a Variable from Worksheet to Workbook | Excel Programming | |||
UserForm not passing Boolean variable | Excel Programming | |||
Passing a value to a variable from Userform | Excel Programming |