Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to efficiently declare variables
I guess I don't understand how to correctly declare variables. Before I had
been writing Dim x1, x2, x3, x4 as double I just learned that this declares x1, x2, and x3 as variants and x4 as a double. Is there an easier way to declare x1, x2, x3 and x4 as double other then typing x1 as double, x2 as double, etc. This seems like a HUGE pain because I have about 75 variables in my module. (These are declared at the modular level, so they can be used by all the macros in the module) Thanks for your help. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to efficiently declare variables
You could maybe use DefDbl :
DefDbl X This means that any variable whose name begins with an X (or x) is automatically a double, unless it's declared otherwise. See Excel Help for more details.. Andrew Jeff wrote: I guess I don't understand how to correctly declare variables. Before I had been writing Dim x1, x2, x3, x4 as double I just learned that this declares x1, x2, and x3 as variants and x4 as a double. Is there an easier way to declare x1, x2, x3 and x4 as double other then typing x1 as double, x2 as double, etc. This seems like a HUGE pain because I have about 75 variables in my module. (These are declared at the modular level, so they can be used by all the macros in the module) Thanks for your help. |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to efficiently declare variables
Nope, that is what you are stuck with.
But honestly, how big a pain is it? As soon as you type D intelliesense gives you a list of values, o a shorter list, and u, Double is at the top. 75 variables is nothing, I have hundreds of constants I declare as Public Const COL_NAME As Long = 17 etc. but I only do it once. -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Jeff" wrote in message ... I guess I don't understand how to correctly declare variables. Before I had been writing Dim x1, x2, x3, x4 as double I just learned that this declares x1, x2, and x3 as variants and x4 as a double. Is there an easier way to declare x1, x2, x3 and x4 as double other then typing x1 as double, x2 as double, etc. This seems like a HUGE pain because I have about 75 variables in my module. (These are declared at the modular level, so they can be used by all the macros in the module) Thanks for your help. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
RE-submitting of: constructing (complex) variables with worksheet functions | Excel Worksheet Functions | |||
Bubble Charts with two non-numerical variables | Excel Worksheet Functions | |||
constructing (complex) variables with worksheet functions | Excel Discussion (Misc queries) | |||
VBA reseting variables | Excel Discussion (Misc queries) | |||
Passing Variables | Excel Discussion (Misc queries) |