Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Forcing Dim Requirement


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

Thanks,

Phi

--
Phil_
-----------------------------------------------------------------------
Phil_V's Profile: http://www.excelforum.com/member.php...fo&userid=3185
View this thread: http://www.excelforum.com/showthread.php?threadid=52371

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Forcing Dim Requirement


type "option explicit" prior to sub

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

Thanks,

Phi


--
kwiklearne
-----------------------------------------------------------------------
kwiklearner's Profile: http://www.excelforum.com/member.php...fo&userid=3190
View this thread: http://www.excelforum.com/showthread.php?threadid=52371

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Forcing Dim Requirement

Check out this link...

http://www.cpearson.com/excel/DeclaringVariables.htm
--
HTH...

Jim Thomlinson


"Phil_V" wrote:


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


  #4   Report Post  
Posted to microsoft.public.excel.programming
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



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
Bedroom Requirement robzrob Excel Worksheet Functions 8 June 29th 08 07:32 PM
Critical requirement. Christopher Naveen[_2_] Excel Worksheet Functions 3 June 22nd 08 01:19 PM
Sum with special requirement firroo Excel Worksheet Functions 2 May 29th 08 09:48 AM
formula requirement pcor New Users to Excel 6 January 7th 06 10:47 PM
if until requirement met Greg Wilson Excel Programming 10 July 28th 05 07:31 PM


All times are GMT +1. The time now is 08:16 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"