Forum Discussion
Need to export data to existing worksheet, not workbook
I have setup a system to export a report from our reservation system to an Excel workbook so I can then do some calculations on the data and format a new report. The thing is that I have to then create 2 separate workbooks, one for the export of the data, and then one that then takes that data from that workbook and imports it into another workbook in order to be able to do the calculations and formatting. I deally I would like to be able to export the data from our reservations system to one specific worksheet within an existing workbook, instead of having to use 2 separate workbooks and overwrite the file every time I need to update the report. Is this possible? I do not have any access to the export command being used by the reservation system, so not sure if that will be an issue.
4 Replies
- SergeiBaklanDiamond Contributor
Perhaps Power Query could help to take data from sheet/book or directly from reservation system and put it into another sheet, transform as necessary.
- Charla74Iron Contributor
It would be possible to create a VBA routine which would move the exported data sheet to the destination file where you will work on it. You would need to create the code in your PERSONAL.XLSB (which means it is resident in Excel itself, rather than a specific workbook) which you could run once you have the exported workbook.
- lamplighterInnCopper Contributor
The whole idea is to not have to create the second workbook to begin with. I already have routines to copy the data from the exported workbook to my calculation workbook. Is there a way to change the "Save as" function to say a specific workbook and worksheet, vs just the name of a workbook? Right now my save as command says save my data to: ".../desktop/dailyreport.xls" Which completely overwrites this file every time. Is there a way to change this to say ".../desktop/dailyreport:worksheet1.xls" ?? and NOT have it completely overwrite the entire file, just the worksheet specified?
- Charla74Iron ContributorlamplighterInn
This then becomes a question about your reservation software rather than Excel, which I am not able to answer with any authority, sorry. At a guess, I would say this would not be possible as you're essentially asking your reservation system to open / edit an existing workbook, and more to the point, it should know exactly what do in there.