Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default 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
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
3 dimension chart jack Charts and Charting in Excel 2 December 9th 08 01:43 AM
Matrix Dimension Michelle Excel Worksheet Functions 1 November 24th 05 05:45 PM
2 dimension lookup myBasic[_2_] Excel Programming 4 September 16th 04 03:29 AM
Array transfer - 1 dimension v. 2 dimension JWolf[_2_] Excel Programming 2 June 29th 04 01:02 AM
Dimension problem APH Excel Programming 5 December 12th 03 11:23 PM


All times are GMT +1. The time now is 01:23 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"