Welcome to the Excel Forum

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.

Seo Services company Manchester

Please Register to Remove these Ads

Please Register to Remove these Ads



Reply
  #1  
Old 07-05-2005, 05:30 PM
Piranha Piranha is offline
Forum Contributor
 
Join Date: 26 Feb 2005
Posts: 175
Piranha is becoming part of the community
Option Explicit

Please Register to Remove these Ads

Hi,

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

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

Thx
Dave
Reply With Quote
  #2  
Old 07-05-2005, 07:05 PM
Anne Troy
Guest
 
Posts: n/a
Re: Option Explicit

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

www.OfficeArticles.com
www.MyExpertsOnline.com


"Piranha" <Piranha.1rpvqf_1120601153.6003@excelforum-nospam.com> wrote in
message news:Piranha.1rpvqf_1120601153.6003@excelforum-nospam.com...
>
> 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 With Quote
  #3  
Old 07-05-2005, 07:05 PM
Dave Peterson
Guest
 
Posts: n/a
Re: 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
Reply With Quote
  #4  
Old 07-05-2005, 07:05 PM
Bob Phillips
Guest
 
Posts: n/a
Re: 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 Tools>Options>Editor, and
check the 'Require Variable Declaration' checkbox.

--

HTH

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


"Piranha" <Piranha.1rpvqf_1120601153.6003@excelforum-nospam.com> wrote in
message news:Piranha.1rpvqf_1120601153.6003@excelforum-nospam.com...
>
> 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 With Quote
  #5  
Old 07-05-2005, 07:05 PM
Chip Pearson
Guest
 
Posts: n/a
Re: 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" <Piranha.1rpvqf_1120601153.6003@excelforum-nospam.com>
wrote in message
news:Piranha.1rpvqf_1120601153.6003@excelforum-nospam.com...
>
> 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 With Quote
  #6  
Old 07-05-2005, 11:18 PM
Piranha Piranha is offline
Forum Contributor
 
Join Date: 26 Feb 2005
Posts: 175
Piranha is becoming part of the community
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

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

www.OfficeArticles.com
www.MyExpertsOnline.com


"Piranha" <Piranha.1rpvqf_1120601153.6003@excelforum-nospam.com> wrote in
message news:Piranha.1rpvqf_1120601153.6003@excelforum-nospam.com...
>
> 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 With Quote


Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump