LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Global/Public

If I have any global variable and/or constants to declare, and they are
limited to one module, which is the better method to declare them:

Option Explicit
Dim myString as String
Const myConst as Integer = 1

Or

Option Explicit

Sub Main()
Public myString as String
Public Const myConst as Integer = 1

What are the advantages and/or limitations of each? And while we're at it,
what about declaring as variable as Static?

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200605/1
 
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 or global array shishi Excel Programming 2 February 6th 06 09:29 PM
Public vs Global quartz[_2_] Excel Programming 2 February 9th 05 06:20 PM
Dim vs. Public Jason Morin Excel Programming 7 January 27th 05 01:13 PM
public sub Bob Excel Programming 3 December 10th 04 08:49 PM
Public Sub Help No Name Excel Programming 2 May 18th 04 11:09 PM


All times are GMT +1. The time now is 01:43 AM.

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"