VBA
(1)
FilterExportSameFile
(1)
Transferspreadsheet
(1)
Transferspreadhseet
(1)
Basedon
(1)

transferspreadsheet to excel with different tab names?

Asked By Phil Smith
12-Nov-09 03:07 PM
I have some code which cycles through a query, resulting in a set of Brands.

When I cycle trough my Brands, I update a query which controls my target
query, then using transferspreadhseet, it sends the results of that
target query query to a different spreadsheet for each brand, the name
of the spreadsheet based on the brand.  Works peachy.

Instead, I want to send the results of each run to a different TAB in
the SAME spreadsheet, with the tab name based on the brand.

I do not know ahead of time the brands that will be picked up, and there
are dozens.  Is there any way to control the name of the resulting tab
from a transfer spreadsheet?

Alternatively, is there a way from within access, to rename a tab in an
excel Worksheet?

Phil

See Create a Query and Export multiple "filtered" versions of a Query (basedon

Ken Snell replied to Phil Smith
12-Nov-09 06:42 PM
See Create a Query and Export multiple "filtered" versions of a Query (based
on data in another table) to separate Worksheets within one EXCEL file via
TransferSpreadsheet (VBA)
http://www.accessmvp.com/KDSnell/EXCEL_Export.htm#FilterExportSameFile

This shows how to do this.

The "trick" is to rename the query before each export. The query name is
transferred to the worksheet tab as the worksheet name.

--

Ken Snell
http://www.accessmvp.com/KDSnell/
Post Question To EggHeadCafe