Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 345
Default Declarations variables, Dim, some guidance please

Absolutely the same as a constant. Many thanks. I'm changing the code now.
you have helped me knock out about 40% of the declared vars.
--
Neal Z


"Bob Phillips" wrote:

Neal,

"Neal Zimm" wrote in message
...
Thanks to all for the sound advice, I hope y'all don't mind a common

response.
I'm relatively new to the VB game, self taught (with help from this

bulletin
board)
, and there's LOTS I don't know. (see later class variables.)

My uses of 'declared' vars in most cases, fall into all of the categories
mentioned.

1. vars where the values DON'T change, but are used by many subs. My
application is called "RM" and
I have a sub called zRM_Values which is called at the begining of larger
macros. (BTW, I have a bad
right pinky finger and typing quotes "" is a bother)

2 examples:

declared: dim Yes as string
in the zrm_values sub, Yes = "Y" , so in any other macro: if
other_var_name = yes then .....

declared: dim PressEnter as string
in zrm_values: PressEnter = "Press Enter or click OK after typing.." &

vbcr
' used in inputbox dialogs


This sound more like a constant than a variable

Const Yes As String = "Y"

declared and initialised in one statemenmt

2. I have tried mightily to have the module declared vars fall into two
other categories:

a) they have the same meaning in any macro in the module so
if the value is changed, it's kinda a good thing for me that other macros
have access to the 'latest' value.

b) I don't care if the value changes.
example: dim x as integer

since I use option explicit, without dim'ing x in every procedure,
I can use: for x = 1 to whatever


3. I have not learned what a "class with properties" is yet, nor
what a collection class is. Is the Excel help adequate on this topic
or can you recommend other reading sources?


I would suggest at this stage you don't bother with classes. Whilst they are
useful, they are rarely an absolute necessity. My point was really at Dave's
statement.




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
Declarations Procedure and Duplicate Declarations Neal Zimm Excel Programming 3 May 31st 05 01:01 AM
Understanding declarations Greg[_16_] Excel Programming 1 January 26th 05 09:35 PM
Help with Array Declarations Mark \(InWales\)[_19_] Excel Programming 4 December 20th 04 06:39 AM
Capitalization in Declarations Phil Hageman[_3_] Excel Programming 16 December 24th 03 11:01 PM
Strange variable declarations Steven Revell Excel Programming 1 August 19th 03 02:19 PM


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