Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default 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
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
Passing Variable to LINEST RW Excel Worksheet Functions 5 May 24th 05 07:00 PM
Passing SQL Query Result Into A Variable Elliot[_2_] Excel Programming 4 January 9th 04 09:55 AM
Passing a Variable from Worksheet to Workbook Susan Lammi Excel Programming 6 August 3rd 03 01:29 AM
UserForm not passing Boolean variable Chip Pearson Excel Programming 2 July 19th 03 06:06 PM
Passing a value to a variable from Userform Neal Steiner Excel Programming 1 July 18th 03 09:12 PM


All times are GMT +1. The time now is 01:55 AM.

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

About Us

"It's about Microsoft Excel"