Comment out entire procedure?

  • Thread starter Thread starter Ed
  • Start date Start date
E

Ed

I have a Workbook_Open procedure that sets some security properties for my
workbook. Unfortunately, these properties make it difficult for me to work
on this after it's run. I can go in and comment out each line of code to
disable the procedure. Can I comment out the first line (as in ' Private Sub
Workbook_Open() ) to disable the entire procedure, rather than having to go
line by line?

Ed
 
Ed,

Just put "Exit Sub" as the first line of code in the procedure.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com (e-mail address removed)
 
Faced the same issue some time ago... I simply renamed the
macro with a different name ( sothat it won't be executed
automatically ) & executed it manually for testing...
 
Hi

In the vb editor under view, Toolbars,Customize,Commands,Edit there is a
comment block button and an uncoment block button. Drag them to the vba
toolbar.
Then,highlight the entire sub you want commented out and click the comment
block button. The whole sub is commented out in one click.
To remove the comments, highlight the entire sub you want uncommented out
and click the uncomment block button.

HTH

Ken
 
Back
Top