Keep Before_Save from running

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have some code in Before_Close that hides and unhides some sheets.

I also have some code in Before_Save that I only want run if the workbook is
trying to be saved by the user, not if I'm the only thing being saved is the
hiding and unhiding of the sheets that's taking place in the Before_Close
macro.

So, I was hoping there's a line of code I can write in the Before_Close
macro that will keep the Before_Save macro from running? Or is it impossible
to keep the Before_Save macro from running since I'm really saving the hiding
and unhiding of sheets? I hope that makes sense. Thank you.
 
In the Before_Close add

ThisWorkbook.Saved = True

which will fool VBA into thinking no changes have been made.

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)
 

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

Back
Top