How to export a query into Excel?

Juleee

New Member
Joined
Jul 27, 2015
Messages
3
Dear all,

I need to export the results from MS Access into Excel file into 3 different worksheets (A, B and C).

While exporting, the Excel file should have a column that includes hyperlink with one fixed part (link to a website) and one variable part (cell in Excel workbook) of the outcome.

Is there a way to do this with Ms Access VBA?

Thanks a lot for your help.
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
vFile = "c:\myfolder\file.xlsx"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, vQry1, vFile, True, "sheet1"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, vQry2, vFile, True, "sheet2"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, vQry3, vFile, True, "sheet3"
 
Upvote 0
Thank you very much.

Another thing I need to do is the following:

1. I need the code to export MS Access data into Excel file
2. While exporting it has to create an additional column in Excel file (SQL based)
3. This column should include the link to the website (which always stays the same) and reference to the excel cell (B2, C2, D2, E2 etc.)
4. The additional column should have special formatting, i.e. text written in red and in Italic.

Is here a way to do this with VBA?

Thanks a lot for your help.
 
Upvote 0

Forum statistics

Threads
1,215,650
Messages
6,126,019
Members
449,280
Latest member
Miahr

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top