Interesting the idea of an array with constants for the array index.
As you say, it has the benefit above a UDT that you can loop through it.
You can't do that with a UDT or can you?
Didn't get this one:
Use 1 long with 'bit flags' to replace a series of booleans.
Could you give a simple example?
RBS
"keepITcool" wrote in message
.com...
Alternatively you can:
Use 1 long with 'bit flags' to replace a series of booleans.
(you'll need to add several constants (or enums if you code for VBA6),
but I find it very convenient for managing data from and to userforms
with many options.
Use arrays for similar variables of same type. Use constants to
identify the position in the array. e.g. iso
rngMain,rngDest,rngSource,rngTemp you'd use
arng(MAIN),arng(DEST),arng(SOURCE),arng(TEMP)
Arguably the above may look like cosmetics, but I find it produces more
readable and manageable code (reset 20 range variables with erase arng)
Further it's fairly easy to implement in an existing situations
with (CAREFULL) search & replace. (use MZtools!)
--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam
RB Smissaert wrote in
When you have a large application with lots of modules and forms and
a large number of public variables what would be the best way to
organize and reduce these public variables? Making all these
variables private or local is not an option as it would mean an
enormous duplication of code. The 2 options I can see are making
classes or UDT's and maybe UDT's are the simplest option. So with a
UDT I would get a public type with a number of elements that are the
old public variables. Then there would be a public variable declared
as this public type. Would this make sense or are there any better
options?
RBS