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


Hi,

Would someone please explain to me the "Option Explicit" phrase.

What does it do?
When should you use it?
Etc

Thx
Dave


--
Piranha
------------------------------------------------------------------------
Piranha's Profile: http://www.excelforum.com/member.php...o&userid=20435
View this thread: http://www.excelforum.com/showthread...hreadid=384692

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 221
Default Option Explicit

Try this, fish:
http://www.vbaexpress.com/forum/arti...ticle&artid=40
*******************
~Anne Troy

www.OfficeArticles.com
www.MyExpertsOnline.com


"Piranha" wrote in
message ...

Hi,

Would someone please explain to me the "Option Explicit" phrase.

What does it do?
When should you use it?
Etc

Thx
Dave


--
Piranha
------------------------------------------------------------------------
Piranha's Profile:

http://www.excelforum.com/member.php...o&userid=20435
View this thread: http://www.excelforum.com/showthread...hreadid=384692



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Option Explicit


Hi,
I don't know how to quote the entire thread so i picked on Anne.

Anne-yes fish :) (at work i am (first -Ima, last Fish,--"Ima Fish")
Dave
Bob
Chip

You guys are wonderfull. Thx for the great info and links.
Now i am trying to soak it up into my brain.

Thx Very Much for your responces
Dave

Anne Troy Wrote:
Try this, fish:
http://www.vbaexpress.com/forum/arti...ticle&artid=40
*******************
~Anne Troy

www.OfficeArticles.com
www.MyExpertsOnline.com


"Piranha" wrote
in
message ...

Hi,

Would someone please explain to me the "Option Explicit" phrase.

What does it do?
When should you use it?
Etc

Thx
Dave


--
Piranha

------------------------------------------------------------------------
Piranha's Profile:

http://www.excelforum.com/member.php...o&userid=20435
View this thread:

http://www.excelforum.com/showthread...hreadid=384692



--
Piranha
------------------------------------------------------------------------
Piranha's Profile: http://www.excelforum.com/member.php...o&userid=20435
View this thread: http://www.excelforum.com/showthread...hreadid=384692

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Option Explicit

It forces you to declare every variable you use in that module.

You should use it in every module that you have.

When this doesn't work like it should
myCtr1 = myCtrl + 1
(one of those has an ELL and one has a ONE)
It really makes debugging easier.

Piranha wrote:

Hi,

Would someone please explain to me the "Option Explicit" phrase.

What does it do?
When should you use it?
Etc

Thx
Dave

--
Piranha
------------------------------------------------------------------------
Piranha's Profile: http://www.excelforum.com/member.php...o&userid=20435
View this thread: http://www.excelforum.com/showthread...hreadid=384692


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Option Explicit

First, you should ALWAYS use it.

What it does it is to force you to explicitly declare your variables. If
you fail to declare them, then you will get a compilation error.

The advantage of using it is that you won't then make the mistake of
mis-spelling (even slightly) variable names deep in the code, as the
compiler will flag it.

You can use the VB IDE to help you by automatically installing this line in
your modules. To do this, in the VB IDE, go to ToolsOptionsEditor, and
check the 'Require Variable Declaration' checkbox.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Piranha" wrote in
message ...

Hi,

Would someone please explain to me the "Option Explicit" phrase.

What does it do?
When should you use it?
Etc

Thx
Dave


--
Piranha
------------------------------------------------------------------------
Piranha's Profile:

http://www.excelforum.com/member.php...o&userid=20435
View this thread: http://www.excelforum.com/showthread...hreadid=384692





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Option Explicit

See http://www.cpearson.com/excel/variables.htm for details.


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


"Piranha"
wrote in message
...

Hi,

Would someone please explain to me the "Option Explicit"
phrase.

What does it do?
When should you use it?
Etc

Thx
Dave


--
Piranha
------------------------------------------------------------------------
Piranha's Profile:
http://www.excelforum.com/member.php...o&userid=20435
View this thread:
http://www.excelforum.com/showthread...hreadid=384692



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
Option Explicit [email protected] Excel Discussion (Misc queries) 5 April 30th 08 11:19 PM
option explicit Dave F Excel Discussion (Misc queries) 2 September 5th 06 02:46 PM
option explicit error helmekki[_50_] Excel Programming 1 November 2nd 04 08:46 PM
Option Commands (Option Explicit / Option Base etc) - Scope Alan Excel Programming 8 November 1st 04 02:22 AM
Option Explicit Grace[_4_] Excel Programming 6 June 12th 04 04:28 PM


All times are GMT +1. The time now is 08:14 PM.

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

About Us

"It's about Microsoft Excel"