View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein \(MVP - VB\) Rick Rothstein \(MVP - VB\) is offline
external usenet poster
 
Posts: 2,202
Default Convenient way to ignore Debug.Assert ?

I put in several Debug.Assert in my code to catch bugs more easily. As I
am
going to deploy the code soon, is there any convenient way to ignore the
Debug statements for the deployment version?


You can use Edit/Replace in the VBA editor to replace them with blank lines.
Put this...

*debug.assert*

in the Find What field, leave the Replace With field blank and put a check
mark in the Use Pattern Matching check box.

The other possibility if you don't want to lose them completely is to turn
them into comments. Again, in Edit/Replace, put this...

debug.assert

in the Find What field and put this...

'debug.assert

(note the leading apostrophe) in the Replace With field.

Rick