Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default public but private variables

how can i make variables public to a particular mobule
(particular project) and still not accessible to other
projects (macros) in the same workbook.

currently i declare variables as Public... as these need
to be used by different procedures in the same macro!

thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default public but private variables

Declare it as Private, but not within a macro, at the head of the module.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

wrote in message
...
how can i make variables public to a particular mobule
(particular project) and still not accessible to other
projects (macros) in the same workbook.

currently i declare variables as Public... as these need
to be used by different procedures in the same macro!

thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default public but private variables

Declare the variables as Private. E.g.,

Private MyVar As Long


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


wrote in message
...
how can i make variables public to a particular mobule
(particular project) and still not accessible to other
projects (macros) in the same workbook.

currently i declare variables as Public... as these need
to be used by different procedures in the same macro!

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
public variables johnny Excel Discussion (Misc queries) 7 February 27th 08 03:44 PM
Public variables johnny Excel Discussion (Misc queries) 2 February 24th 08 05:05 AM
Public Variables Jerry McNabb Excel Discussion (Misc queries) 0 February 24th 08 01:26 AM
difference between a private sub and a public function? Dave F Excel Discussion (Misc queries) 4 March 16th 07 07:38 PM
Public subroutine called from a private sub Neil Bhandar[_2_] Excel Programming 1 January 15th 04 10:23 PM


All times are GMT +1. The time now is 07:57 PM.

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

About Us

"It's about Microsoft Excel"