Comment out entire procedure?

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
 
C

Chip Pearson

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)
 
S

Six

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...
 
K

Ken Macksey

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top