Export Queries to a Multi-tabbed Spreadsheet

This code can be used to export multiple queries into a single, multi-tabbed workbook in excel.  The image below is what the code will look like in your module, while the text below the image can be copied and pasted (you will need to modify the query name and export locations).

 

export multi-tabbed spreadsheet

Private Sub Command37_Click()
'Exports each of the queries into a multi-tabbed spreadsheet
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "qry_IIF1_Calculations", "V:\Human Resources\HR OPS\Compensation\Long Term Incentives\Extracts\LTI_Detailed_Report.xls", True
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "qry_IIF2_Calculations", "V:\Human Resources\HR OPS\Compensation\Long Term Incentives\Extracts\LTI_Detailed_Report.xls", True
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "qry_IDF1_Calculations", "V:\Human Resources\HR OPS\Compensation\Long Term Incentives\Extracts\LTI_Detailed_Report.xls", True
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "qry_ISF1-BS_Calculations", "V:\Human Resources\HR OPS\Compensation\Long Term Incentives\Extracts\LTI_Detailed_Report.xls", True
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "qry_IDF1-BS_Calculations", "V:\Human Resources\HR OPS\Compensation\Long Term Incentives\Extracts\LTI_Detailed_Report.xls", True
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "qry_IVM_Calculations", "V:\Human Resources\HR OPS\Compensation\Long Term Incentives\Extracts\LTI_Detailed_Report.xls", True
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "qry_LDP_Calculations", "V:\Human Resources\HR OPS\Compensation\Long Term Incentives\Extracts\LTI_Detailed_Report.xls", True
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "qry_ISF2_Calculations", "V:\Human Resources\HR OPS\Compensation\Long Term Incentives\Extracts\LTI_Detailed_Report.xls", True

'Opens the file you just created
Application.FollowHyperlink "V:\Human Resources\HR OPS\Compensation\Long Term Incentives\Extracts\LTI_Detailed_Report.xls"

End Sub