Close worksheet by means of a macro

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

Guest

Hi

I need to close a worksheet with a button, so I need a macro to attach.

Thanksing you
 
You can't close a worksheet, you can hide it or switch to another sheet or
even close the workbook. Which do you want to do?

You can switch to
 
try this

Sub Button1_Click()
ActiveWorkbook.Close savechanges = True
End Sub

savechanges could also be False
 

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