# Microsoft Office Application Help - Excel Help forum > Excel Programming / VBA / Macros >  >  Is there a break statement in VBA

## Shani

What statement can i use to break out of a loop?

how do i call a procdedure?

How do i declare a universal variable that all sub() can use?

appreciate the help. Thanks

----------


## Tushar Mehta

(a) Search XL VBA help (or I imagine Word VBA or PP VBA or Access VBA or...)
for 'loop' (w/o the quotes).  One of the suggested topics will be
'Do..Loop'  Look it up and you'll find the way to break out of a loop

(b) See the XL VBA topic 'Calling Sub and Function Procedures'

(c) Search XL VBA help for 'universal variable' (w/o the quotes).  One of
the suggested topics will be 'Understanding the Lifetime of Variables'

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article <1144945188.402721.4370@i39g2000cwa.googlegroups.com>, Shani718
@gmail.com says...
> What statement can i use to break out of a loop?
>
> how do i call a procdedure?
>
> How do i declare a universal variable that all sub() can use?
>
> appreciate the help. Thanks
>
>

----------


## John

"Shani" <Shani718@gmail.com> wrote in message
news:1144945188.402721.4370@i39g2000cwa.googlegroups.com...
> What statement can i use to break out of a loop?

Exit For / Do / While

> how do i call a procdedure?

Call MyProc()

> How do i declare a universal variable that all sub() can use?

Lookup "Public statement" in VBE help

> appreciate the help. Thanks

My pleasure  :Smilie:

----------


## Tushar Mehta

In article <emo50hxXGHA.1192@TK2MSFTNGP03.phx.gbl>, JohnSickOfSpam@AOL.net
says...
>
{snip}
>
> My pleasure  :Smilie: 
>
>
>
Hopefully, you will also the credit for the homework. {grin}

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

----------


## John

Go to the top of the class Tushar  :Smilie: !
John

"Tushar Mehta" <tmUnderscore200310@tushar-mehta.SeeOhEm> wrote in message
news:MPG.1ea84ae71f81af6098b390@msnews.microsoft.com...
> In article <emo50hxXGHA.1192@TK2MSFTNGP03.phx.gbl>, JohnSickOfSpam@AOL.net
> says...
>>
> {snip}
>>
>> My pleasure  :Smilie: 
>>
>>
>>
> Hopefully, you will also the credit for the homework. {grin}
>
> --
> Regards,
>
> Tushar Mehta
> www.tushar-mehta.com
> Excel, PowerPoint, and VBA add-ins, tutorials
> Custom MS Office productivity solutions

----------


## Patricia Shannon

If using a universal variable (static, public), be sure to exit your
procedure by falling thru the "End Sub" or using and "Exit Sub".  The "End"
statement resets variables.

"Shani" wrote:

> What statement can i use to break out of a loop?
>
> how do i call a procdedure?
>
> How do i declare a universal variable that all sub() can use?
>
> appreciate the help. Thanks
>
>

----------

