Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
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 |
#2
![]() |
|||
|
|||
![]()
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 "lunker55" wrote: 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 |
#3
![]() |
|||
|
|||
![]()
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. --- Regards, Norman "lunker55" wrote in message ... 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 |
#4
![]() |
|||
|
|||
![]()
Easy way to do it is record a 3rd macro while clicking macro 1 & macro 2 and
call it maro 3 "lunker55" wrote: 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 |
#5
![]() |
|||
|
|||
![]()
Thank you both!
Joe "lunker55" wrote in message ... 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 |
#6
![]() |
|||
|
|||
![]()
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 -- Don Guillett SalesAid Software "lunker55" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Command Button anomalies | Excel Discussion (Misc queries) | |||
Enabling macros | Excel Discussion (Misc queries) | |||
sorting with macros | Excel Discussion (Misc queries) | |||
Command Button VBA code | Excel Discussion (Misc queries) | |||
Transferring toolbars and macros to other computers | Excel Discussion (Misc queries) |