ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Public Variables (https://www.excelbanter.com/excel-programming/338941-public-variables.html)

[email protected]

Public Variables
 
Running XL 2003 in XP. I'm trying to share a variable between 2 subs,
each in a different module. Don't I just have to use the Public
statement? Such as...

Public dNTP as Date

The first sub is in Module6 and calls the second sub in Module1. So I
have the above statement in Module6.

Any help is greatly appreciated.

John


Tom Ogilvy

Public Variables
 
At the top of Module 6, outside any sub or function put your declaration

Public dNTP as Date

Should be visible to all modules in the same workbook.

--
Regards,
Tom Ogilvy

wrote in message
oups.com...
Running XL 2003 in XP. I'm trying to share a variable between 2 subs,
each in a different module. Don't I just have to use the Public
statement? Such as...

Public dNTP as Date

The first sub is in Module6 and calls the second sub in Module1. So I
have the above statement in Module6.

Any help is greatly appreciated.

John





All times are GMT +1. The time now is 11:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com