LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Ignore breakpoint when running a macro

Hi hmm,

Not sure, Helmut, I understand what the code does, or how to implement it.
Can you explain it? Thanks.


That was probably too simple.
I define a boolean variable "myStop".
If I want the code to stop,
I set "myStop" to true, like

Sub Test9987()
Dim Mystop As Boolean '!
Mystop = True
' your Excel code goes in here
if myStop then stop
' more Excel code goes in here
if myStop then stop
' more Excel code goes in here
End sub

If myStop is true then the sub stops
at every line "if myStop then stop"

If myStop is false, which is the default value,
then the code doesn't stop at all.

You may even define different boolean variables
or an array of booleans, in order to stop only
at certain lines, like:

Sub Test9987A()
Dim Mystop1 As Boolean '!
Dim Mystop2 As Boolean '!
Mystop1 = True
' your Excel code goes in here
if myStop1 then stop
' more Excel code goes in here
if myStop2 then stop
' more Excel code goes in here
End sub

which will stop only at "if myStop1 then stop"

HTH

--

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Vista Small Business, Office XP
 
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
breakpoint calculation John C[_2_] Excel Worksheet Functions 0 October 22nd 08 02:27 PM
Find used range and ignore blank cells when running macro? Rick S. Excel Programming 3 October 3rd 07 02:52 PM
breakpoint affecting the run speed of a macro kebabb Excel Programming 3 December 2nd 06 05:17 AM
Breakpoint ok, no breakpoint messes up... Vikxcel[_8_] Excel Programming 0 January 4th 06 09:18 PM


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