Combining 3 macros to 1

  • Thread starter Thread starter David
  • Start date Start date
D

David

I have 3 macros below that I have to run separately. How can I
combine them into 1? Thanks.

Sub Save()
ActiveWorkbook.Save
End Sub
Sub SaveName()
ActiveWorkbook.SaveAs Filename:="Q:\David\dailysales.xls"
End Sub
Sub Email()
ActiveWorkbook.SendMail Recipients:="test"
End Sub
 
Just?

Sub Save()
With ActiveWorkbook
.Save
.SaveAs Filename:="Q:\David\dailysales.xls"
.SendMail Recipients:="test"
End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Hi
note: this will save the workbook twice: With the old name ans as a new
name:
Sub Save_combine()
ActiveWorkbook.Save
ActiveWorkbook.SaveAs Filename:="Q:\David\dailysales.xls"
ActiveWorkbook.SendMail Recipients:="test"
End Sub
 
Adding to the others: Consider using
SaveCopyAs
instead of SaveAs. That way you're still in the original file/folder.
 

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