Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Varible scope

Is it possible to declare a varible that can be seen (availble) from any
Sub(routine) within the current Module1?

If so How
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Varible scope

Declare the variable outside of and before any procedure declaration. Use
"Public" instead of "Dim" if you want to variable to be visible from any
module (not just the module in which it is declared) or use "Private"
instead of "Dim" if you want the variable to be visible only from within the
module in which it is declared.


--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)



"miek" wrote in message
...
Is it possible to declare a varible that can be seen (availble) from any
Sub(routine) within the current Module1?

If so How


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Varible scope

At the top of the module:
Dim myVar as Variant 'or whatever.

Use:
Public myVar as Variant
If you want it seen in all modules.

miek wrote:

Is it possible to declare a varible that can be seen (availble) from any
Sub(routine) within the current Module1?

If so How


--

Dave Peterson
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
same varible in formula jheiser57 Excel Worksheet Functions 0 June 21st 10 04:49 PM
varible calculation kinsey New Users to Excel 7 September 30th 07 08:50 AM
Unserform with a varible mushy_peas[_30_] Excel Programming 4 April 20th 04 11:06 PM
Varible in a Range mushy_peas[_11_] Excel Programming 3 January 17th 04 02:06 AM
how to start from varible row Vimal[_2_] Excel Programming 2 October 14th 03 08:44 AM


All times are GMT +1. The time now is 04:51 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"