OOps... I meant to remove that.
 
But I'll explain.
When debugging a large/complex macro, it's often helpful to use "breakpoints".
 
(do you use breakpoints?)
Breakpoints:
you select a line and hit the "hand" icon or simply click in the left-hand 
border in the editor.
 
I've often had SEVERAL breakpoints in a large macro.
 
But, when you save and exit your workbook and return, the breakpoints are 
GONE!!!
Also, I've often used a technique in which I'm processing thousands of records 
and I want to pause at record #999 or when a value is something specific so 
that I can step throught the code to see what's going on.
 
In a case like this, using 
Debug.Assert False
 
PAUSES the macro, just like a breakpoint.
Debug.Assert True passes through and does nothing.
 
What I've done on large macros is use a "BreakFlag", and:
 Debug.Assert BreakFlag
whereever I need a breakpoint.
 
Then, when record # or value = what I'm looking for, I set BreakFlag = false.
 
Then, to continue without further breaks, simply set breakflag = true and run!
 
I use it a lot when I'm testing code for these user groups, then remove them 
before posting.
 
Guess I missed one!
 

Paul
-----------------------------------------
“Do all the good you can,
By all the means you can,
In all the ways you can,
In all the places you can,
At all the times you can,
To all the people you can,
As long as ever you can.” - John Wesley
-----------------------------------------


>________________________________
> From: Prafull Jadhav <prafulltjad...@gmail.com>
>To: "excel-macros@googlegroups.com" <excel-macros@googlegroups.com> 
>Sent: Saturday, November 22, 2014 9:57 AM
>Subject: Re: $$Excel-Macros$$ Re: VBA
>  
>
>
>Dear Paul Sir,
>Can you please explain what is 
>  "Debug.Assert True"
>
>
>
>Regards,
>Prafull Jadhav
>9920553518
> 
>
>
>
>
>On 22 November 2014 at 09:55, Mandeep Baluja <rockerna...@gmail.com> wrote:
>
>Hello Paul, 
>>
>>
>>First I would like to thank you from bottom of my heart for making such an 
>>efficient code to handle such a bad formatted data. Today I got to know that 
>>experience pays off you're brilliant in your efforts. As I have 4 months of 
>>experience in VBA Still I understand every line of your code except this , 
>>Debug.assert = True , If ((ActiveSheet.Range("A1").Value & "X" = "X") _
>>And (ActiveSheet.Range("B1").Value & "X" <> "X")). 
>>
>>
>>if(Query = True, " Paul will handle it,"" Paul will handle it") :P 
>>
>>
>>Cheers 
>>
>>
>>Regards,
>>Mandeep Baluja 
>>
>>
>>https://www.linkedin.com/profile/view?id=312532939
>>https://www.facebook.com/VBAEXCELSQL?ref=hl
>>
>>On Thursday, November 20, 2014 4:59:00 PM UTC+5:30, Mandeep Baluja wrote:
>>Dear All, 
>>>
>>>
>>>I need to work on Data sheet which contains all the cells in text format. 
>>>basically its a timing sheet. I want to change the format of all the time 
>>>values in correct format and wish to highlight those cells where people come 
>>>after 10:00 am .Hope you can understand this by going through the 
>>>sheet.Looking for a Macro which can correct the format of time 
>>>automatically. 
>>>
>>>
>>>Regards, 
>>>Mandeep Baluja
>>-- 
>>Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
>>=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
>>https://www.facebook.com/discussexcel
>> 
>>FORUM RULES
>> 
>>1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
>>Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not 
>>get quick attention or may not be answered.
>>2) Don't post a question in the thread of another member.
>>3) Don't post questions regarding breaking or bypassing any security measure.
>>4) Acknowledge the responses you receive, good or bad.
>>5) Jobs posting is not allowed.
>>6) Sharing copyrighted material and their links is not allowed.
>> 
>>NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
>>members are not responsible for any loss.
>>--- 
>>You received this message because you are subscribed to the Google Groups "MS 
>>EXCEL AND VBA MACROS" group.
>>To unsubscribe from this group and stop receiving emails from it, send an 
>>email to excel-macros+unsubscr...@googlegroups.com.
>>To post to this group, send email to excel-macros@googlegroups.com.
>>Visit this group at http://groups.google.com/group/excel-macros.
>>For more options, visit https://groups.google.com/d/optout.
>>
>
-- 
>Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
>=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
>https://www.facebook.com/discussexcel
> 
>FORUM RULES
> 
>1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
>Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
>quick attention or may not be answered.
>2) Don't post a question in the thread of another member.
>3) Don't post questions regarding breaking or bypassing any security measure.
>4) Acknowledge the responses you receive, good or bad.
>5) Jobs posting is not allowed.
>6) Sharing copyrighted material and their links is not allowed.
> 
>NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
>members are not responsible for any loss.
>--- 
>You received this message because you are subscribed to the Google Groups "MS 
>EXCEL AND VBA MACROS" group.
>To unsubscribe from this group and stop receiving emails from it, send an 
>email to excel-macros+unsubscr...@googlegroups.com.
>To post to this group, send email to excel-macros@googlegroups.com.
>Visit this group at http://groups.google.com/group/excel-macros.
>For more options, visit https://groups.google.com/d/optout.
>
>
>    

-- 
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.

NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to excel-macros+unsubscr...@googlegroups.com.
To post to this group, send email to excel-macros@googlegroups.com.
Visit this group at http://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/d/optout.

Reply via email to