Hello All and Good Day
Is there a way to select 2 Fields from an Access 2010 Query (say columns 4 and 5) and paste them to an Excel Spreadsheet transposing them as rows 1 and 2 across the top of the spreadsheet?
I currently send 22 of the entire Queries (only 4 listed below) to Excel using the following:
Private Sub Command19_Click()
DoCmd.TransferSpreadsheet acExport, 8, "***********", "D:\*******.xls", True,
DoCmd.TransferSpreadsheet acExport, 8, "01_********", "D:\*******.xls", True,
DoCmd.TransferSpreadsheet acExport, 8, "02_*********", "D:\******.xls", True,
DoCmd.TransferSpreadsheet acExport, 8, "03_*********", "D:\******.xls", True,
End Sub
This code works fine for what it was useful for, but I am now creating an analysis template and I need Query columns 4 and 5 from the “filtered” queries to become spreadsheet rows 1 and 2 in each of the 22 tabs.
I know I can write a Macro in the Excel template to delete the un-needed data from the queries, and cut and transpose the data from coulmns 3 and 4 into the needed rows, but I was looking for a simple button click from Access to do the job as I will not be the only template user and there will be some users with very little experience.
I have searched the Board for answers but none seem to address this situation.
Any assistance would be appreciated?
Romefucan
Is there a way to select 2 Fields from an Access 2010 Query (say columns 4 and 5) and paste them to an Excel Spreadsheet transposing them as rows 1 and 2 across the top of the spreadsheet?
I currently send 22 of the entire Queries (only 4 listed below) to Excel using the following:
Private Sub Command19_Click()
DoCmd.TransferSpreadsheet acExport, 8, "***********", "D:\*******.xls", True,
DoCmd.TransferSpreadsheet acExport, 8, "01_********", "D:\*******.xls", True,
DoCmd.TransferSpreadsheet acExport, 8, "02_*********", "D:\******.xls", True,
DoCmd.TransferSpreadsheet acExport, 8, "03_*********", "D:\******.xls", True,
End Sub
This code works fine for what it was useful for, but I am now creating an analysis template and I need Query columns 4 and 5 from the “filtered” queries to become spreadsheet rows 1 and 2 in each of the 22 tabs.
I know I can write a Macro in the Excel template to delete the un-needed data from the queries, and cut and transpose the data from coulmns 3 and 4 into the needed rows, but I was looking for a simple button click from Access to do the job as I will not be the only template user and there will be some users with very little experience.
I have searched the Board for answers but none seem to address this situation.
Any assistance would be appreciated?
Romefucan