Hi,
Two ways I know of:
Public A As .......
as opposed to:
Dim A As ......
The 'Public' statement goes in any module, but outside any sub.
The value of the variable will be available while the workbook remains open, 
but will be lost when the workbook closes.
The other way is to store the variable value in any unused cell.
Sheets("Data").Range("A1") = A
This method maintains the value of the variable even after the workbook is 
closed and re-opened.
Regards - Dave.

Date: Mon, 1 Mar 2010 02:31:53 +0530
Subject: $$Excel-Macros$$ Data in variables
From: [email protected]
To: [email protected]

Hi,
 
Is it possible to keep the value stored in the variable till the time the sheet 
is running or the code is running.
 
Example: I have to a variable A and B, which i need to use to store information 
from a form, this information will be used in other modules or procedures. Is 
it possbile to keep the value stored in the variables till the time the sheet 
is open. Because i may require this information in different small procedures, 
which run at a different time.

 
Please suggest
 
Harpreet
 




-- 

----------------------------------------------------------------------------------

Some important links for excel users:

1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip

2. Join our Facebook Group @ http://www.facebook.com/group.php?gid=287779555678

3. Excel tutorials at http://www.excel-macros.blogspot.com

4. Learn VBA Macros at http://www.quickvba.blogspot.com

5. Excel Tips and Tricks at http://exceldailytip.blogspot.com

 

To post to this group, send email to [email protected]

 

<><><><><><><><><><><><><><><><><><><><><><>

HELP US GROW !!

 

We reach over 6,800 subscribers worldwide and receive many nice notes about the 
learning and support from the group.Let friends and co-workers know they can 
subscribe to group at http://groups.google.com/group/excel-macros/subscribe
                                          
_________________________________________________________________
If it exists, you'll find it on SEEK. Australia's #1 job site
http://clk.atdmt.com/NMN/go/157639755/direct/01/

-- 
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Join our Facebook Group @ http://www.facebook.com/group.php?gid=287779555678
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 
To post to this group, send email to [email protected]

<><><><><><><><><><><><><><><><><><><><><><>
HELP US GROW !!

We reach over 6,800 subscribers worldwide and receive many nice notes about the 
learning and support from the group.Let friends and co-workers know they can 
subscribe to group at http://groups.google.com/group/excel-macros/subscribe

Reply via email to