I was wondering if it was possible to run a macro in Access to append these queries into one Excel sheet?
I have a functioning macro that results in two sheets but I want to see if I can get into one sheet to avoid user error.
Private Sub Command12_Click()
exportToXl ("Booking Override Query")
exportToXl ("Shipping Override Query")
MsgBox "Successfully Exported to M:\Automated Planning Reporting"
Sub exportToXl(QueryName As String)
Dim dbTable As String
Dim xlWorksheetPath As String
xlWorksheetPath = "M:\Automated Planning Reporting\"
xlWorksheetPath = xlWorksheetPath & "Export_Ship " & Format(Date, "MM-dd-yyyy") & ".xlsx"
DoCmd.TransferSpreadsheet acExport, 10, QueryName, xlWorksheetPath, True
'- See more at: http://www.askeygeek.com/vba-code-to-export-access-data-to-excel/#sthash.pK0862gD.dpuf