If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Macro to Export Query Data to Excel Spreadsheet
Hello,
I have read through a number of threads and have tried the suggested methods but I still can't seem to get this to work. I am trying to create a Macro (using TransferSpreadsheet) to export data from a query to an Excel Spreadsheet. I would LIKE it to dump the data into an already create worksheet but I can't get it to. The name of the query is "B001 PSA". I created a brand new workbook formatted the way I want and named the tab B001. I have tried putting "B001!" in the Range column and it tells me "B001'$'" already exists. If I leave the "!" off, it just creates a new worksheet titled "_B001". I even tried putting B001!A:H and it tells me those cells already exist. I tried naming the worksheet tab "B001_PSA" but then it creates "B001_PSA1". Is this possible or am I stuck manually formatting the Excel spreadsheet? Btw, I'm using Office 2007. Thanks! -Sara |
#2
|
|||
|
|||
Macro to Export Query Data to Excel Spreadsheet
Hi Sara,
Untried: Mybe go about it in reverse. How about creating a macro in the Excel document to clear out the current data and reimport it? Clifford Bass "Sara" wrote: Hello, I have read through a number of threads and have tried the suggested methods but I still can't seem to get this to work. I am trying to create a Macro (using TransferSpreadsheet) to export data from a query to an Excel Spreadsheet. I would LIKE it to dump the data into an already create worksheet but I can't get it to. The name of the query is "B001 PSA". I created a brand new workbook formatted the way I want and named the tab B001. I have tried putting "B001!" in the Range column and it tells me "B001'$'" already exists. If I leave the "!" off, it just creates a new worksheet titled "_B001". I even tried putting B001!A:H and it tells me those cells already exist. I tried naming the worksheet tab "B001_PSA" but then it creates "B001_PSA1". Is this possible or am I stuck manually formatting the Excel spreadsheet? Btw, I'm using Office 2007. Thanks! -Sara |
Thread Tools | |
Display Modes | |
|
|