Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Combining 3 macros to 1

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Combining 3 macros to 1

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)

"David" wrote in message
om...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Combining 3 macros to 1

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

--
Regards
Frank Kabel
Frankfurt, Germany


David wrote:
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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default Combining 3 macros to 1

Adding to the others: Consider using
SaveCopyAs
instead of SaveAs. That way you're still in the original file/folder.

--
HTH. Best wishes Harald
Followup to newsgroup only please

"David" skrev i melding
om...
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Combining two macros Colin Hayes Excel Discussion (Misc queries) 2 June 7th 11 02:28 PM
Combining Macros and if function perl Excel Worksheet Functions 2 September 19th 09 03:04 PM
Combining macros aussiegirlone Excel Discussion (Misc queries) 9 June 30th 09 03:14 AM
Combining macros GarToms Excel Discussion (Misc queries) 2 February 9th 06 08:51 AM
Suppress the Disable Macros / Enable Macros Dialog Shoji Karai Excel Programming 5 September 24th 03 03:10 AM


All times are GMT +1. The time now is 10:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"