1 button for 2 macros

  • Thread starter Thread starter lunker55
  • Start date Start date
L

lunker55

I have two macros. I would like to press 1 macro button that will do both
macros.
Is there a way to do this?
Macros are below,
Joe

Sub SaveAsCellString()
ActiveWorkbook.SaveAs Filename:= _
"C:\shipway\invoices\" & Range("E5").Formula,
FileFormat:=xlExcel9795, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False
End Sub



Sub clearform()
'
' clearform Macro
' Macro recorded 20/06/2005 by Joe Clarkson
'

'
Range("A16:C28").Select
Selection.ClearContents
Range("E8").Select
Selection.ClearContents
End Sub
 
Lunker55,

Amalgamate you macros.

Assume that the first macro is called Save and the second macro is called
clearform. Assume that you want to run CLEARFORM after SAVE do the following:-

Just before the END SUB in SAVE type CLEARFORM

HTH

Pank
 
Hi Joe,

Try assigning the following macro to your button:

SubRunBoth()
Call clearform
Call SaveAsCellString
End Sub

This assumes that you want to the clearform macro to be run first. If this
assumption is wrong, reverse the sequence of the two Call statements.
 
Easy way to do it is record a 3rd macro while clicking macro 1 & macro 2 and
call it maro 3
 
this should do it. I do NOT recommend saying as 97/95. Just save as an excel
file.

Sub SaveAsCellString()
Range("A16:C28,e8").ClearContents
ActiveWorkbook.SaveAs Filename:= _
"C:\shipway\invoices\" & Range("E5")
End Sub
 

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