Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Quickly Dimension used variables
I have recently decided to use the option explicit method. I now need
to go through all my codes to find all the variables and dimension them. Does anyone have suggestions on how to speedily do this. For example, it would be cool if there was a macro that you could run on the code itself that would dimension all your undimensioned variables. Thoughts? Suggestions? Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Quickly Dimension used variables
One approach: ensure "Option Explicit" is at the top of your module, then
compile the code. You should get compiler error w/the variable that is not dimmed highlighted. I don't know if there is code that can do this for you, but I would question how it would know what variable type to use in the Dim statement (if you are going through the trouble of declaring your variables, you may as well be specific as to what data type they are - as long as the noose is around your neck you may as well jump off the horse <g). Declaring a specific variable type, when possible, is more efficient than having everything declared as a variant. "Rion" wrote: I have recently decided to use the option explicit method. I now need to go through all my codes to find all the variables and dimension them. Does anyone have suggestions on how to speedily do this. For example, it would be cool if there was a macro that you could run on the code itself that would dimension all your undimensioned variables. Thoughts? Suggestions? Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
3 dimension chart | Charts and Charting in Excel | |||
Matrix Dimension | Excel Worksheet Functions | |||
2 dimension lookup | Excel Programming | |||
Array transfer - 1 dimension v. 2 dimension | Excel Programming | |||
Dimension problem | Excel Programming |