View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default Automatically Deleting Comments In VBA

The following method is aggressive as it will remove things that looked like comments inside of text constants within your code. If you can live with that, just call up the Replace dialog box with the VB editor (Edit/Replace from the menu bar or Ctrl+H from the keyboard), put '* (that is an apostrophe followed by an asterisk) in the "Find What" field, leave the Replace field empty, select the "Current Project" OptionButton from the Search frame and put a checkmark in the "Use Pattern Matching" CheckBox, then click the "Replace All" CommandButton... that should remove all comments (both inline and stand alone ones) that start with an apostrophe (it will not do comments that start with the Rem keyword).

--
Rick (MVP - Excel)


"Dennis Tucker" wrote in message ...
Is there any tool available to automatically strip only the comments from a VBA project?

Dennis