View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Forcing Dim Requirement

Put Option Explicit as the very first line in your code
module(s), before and outside of any procedure declaration.

You can have this automatically placed in new modules. In VBA go
to the Tools menu, choose Options, then the Editor tab. There,
place a check next to "Require Variable Declaration".


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Phil_V"
wrote in message
...

How do I set the option in Excel VBA that I MUST Dim variable
before
using them? I would prefer it this way to the default where
Excel just
'creates' variables that are spelt differently etc.

Thanks,

Phil


--
Phil_V
------------------------------------------------------------------------
Phil_V's Profile:
http://www.excelforum.com/member.php...o&userid=31857
View this thread:
http://www.excelforum.com/showthread...hreadid=523711