#1   Report Post  
Posted to microsoft.public.excel.misc
CWillis
 
Posts: n/a
Default Sharing Variables

I give a variable a value in a macro inside a worksheet. I want it to be
available later in other macros in other worksheets and in "ThisWorkbook".
How do I do this?

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Sharing Variables

How about just declaring that variable as Public in a General module?

CWillis wrote:

I give a variable a value in a macro inside a worksheet. I want it to be
available later in other macros in other worksheets and in "ThisWorkbook".
How do I do this?

Thanks.


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
Daniel CHEN
 
Posts: n/a
Default Sharing Variables

If you want the variable to be accessable in the same module, you can define
the variable (use dim statement) outside of all functions/procedures and put
it at the top of coding.

If you want the variable to be accessable in other modules, use public
statement.


--
Best regards,
---
Yongjun CHEN
==================================
- - - - www.XLDataSoft.com - - - -
Free Excel/VBA Tool & Training Material
==================================
"CWillis" wrote in message
...
I give a variable a value in a macro inside a worksheet. I want it to be
available later in other macros in other worksheets and in "ThisWorkbook".
How do I do this?

Thanks.



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
Bubble Charts with two non-numerical variables andy62 Excel Worksheet Functions 2 May 22nd 06 01:08 AM
Sharing read-write Excel 2003 files ttt8262 Excel Discussion (Misc queries) 0 April 1st 06 09:39 PM
VBA reseting variables Jeff Excel Discussion (Misc queries) 0 February 4th 06 08:22 PM
VBA reseting variables bpeltzer Excel Discussion (Misc queries) 0 February 4th 06 03:52 PM
Passing Variables Jeff Excel Discussion (Misc queries) 1 November 4th 05 06:46 PM


All times are GMT +1. The time now is 02:26 PM.

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"