Hi All!
Just a quick question. I have VBA code exporting multiple queries to multiple tabs in a single Excel Workbook (Access 2007 user).
I have posted the code below.
I need to modify this code to do 2 formatting things:
1) Bold the headers on each sheet.
2) Autofit (or BestFit) all of the columns on each sheet.
I have the queries BestFit set when viewed as a datasheet, but it does not retain this setting upon export.
Thanks!
Mike
Just a quick question. I have VBA code exporting multiple queries to multiple tabs in a single Excel Workbook (Access 2007 user).
I have posted the code below.
I need to modify this code to do 2 formatting things:
1) Bold the headers on each sheet.
2) Autofit (or BestFit) all of the columns on each sheet.
I have the queries BestFit set when viewed as a datasheet, but it does not retain this setting upon export.
Thanks!
Mike
Code:
Private Sub Command162_Click()
DoCmd.TransferSpreadsheet 1, 8, "US T1-DOMESTIC ARC List", "C:\Users\" & [Forms]![Main Menu]![userID] & "\Desktop\US Monthly Export.xls", True, "US ARC List"
DoCmd.TransferSpreadsheet 1, 8, "CA T2-IATA List", "C:\Users\" & [Forms]![Main Menu]![userID] & "\Desktop\US Monthly Export.xls", True, "Canada IATA List"
DoCmd.TransferSpreadsheet 1, 8, "US T3-IATAN Only List", "C:\Users\" & [Forms]![Main Menu]![userID] & "\Desktop\US Monthly Export.xls", True, "US IATAN Only"
DoCmd.TransferSpreadsheet 1, 8, "US T4-INTL IATA List", "C:\Users\" & [Forms]![Main Menu]![userID] & "\Desktop\US Monthly Export.xls", True, "M&G INTL IATA List"
DoCmd.TransferSpreadsheet 1, 8, "US T5-ARC-IATA Additions", "C:\Users\" & [Forms]![Main Menu]![userID] & "\Desktop\US Monthly Export.xls", True, "ARC-IATA Additions"
DoCmd.TransferSpreadsheet 1, 8, "US T6-ARC-IATA Deletions & Closures", "C:\Users\" & [Forms]![Main Menu]![userID] & "\Desktop\US Monthly Export.xls", True, "ARC-IATA Deletions & Closures"
DoCmd.TransferSpreadsheet 1, 8, "US T7-ARC-IATA Changes", "C:\Users\" & [Forms]![Main Menu]![userID] & "\Desktop\US Monthly Export.xls", True, "ARC-IATA Changes"
DoCmd.TransferSpreadsheet 1, 8, "US T8-CTD Info", "C:\Users\" & [Forms]![Main Menu]![userID] & "\Desktop\US Monthly Export.xls", True, "CTD Info"
End Sub