Hi,
I have a macro-enabled workbook with a calculation table
These are the steps I need help with.
1. I wish to copy the sheet of a downloaded workbook, however, the workbook is "$XXXX" but when you enable content it changes to "Book1". Ideally I want the original workbook name as it is unique but will the macro work if I ignore the enabled content option? As a side question, why does the filename change when you enable content?
If I enable content then I can't rely on setting the the destination workbook as "Book1" as I imagine if another Excel workbook is open then the filename will change to "Book2"?
2. The sheetname is unique, e.g. "Freexxxx" so I can reference that as well. I wish to copy this to a named worksheet in my macro-enabled. Let's say my workbook is called "FreexxxxCalculator", I presume I'll need the full filename including the file type? e.g. .xlsm. to drill down further I will also like it to be copied over to the worksheet "Calc_Data".
3. I am then able to perform the macro and the calculations which are done on the "Calculator" worksheetname.
4. So once the calculation table is done I then wish to copy this to the original workbook "$Freexxxx" or Book 1 and save as a normal workbook rather than a macro-enabled workbook.
5. ensure the Calculaton workbook is never saved so that everytime the calculation is run it will always calculate new source data.
Putting it simply I wish to copy data from the downloaded workbook (which can have two different filenames depending on enable content) to the calculator workbook - where I run a macro to delete all unnecessary rows (which I've done), apply the data in columns and rows to the Calculator (which I've done) and the end result is to have the original source data and the calculation table in a single workbook on two separate tabs and ensure the calculator workbook closes without saving so the template is untouched.
I hope the above makes sense and I'll appreciate any help!
Thanks,
I have a macro-enabled workbook with a calculation table
These are the steps I need help with.
1. I wish to copy the sheet of a downloaded workbook, however, the workbook is "$XXXX" but when you enable content it changes to "Book1". Ideally I want the original workbook name as it is unique but will the macro work if I ignore the enabled content option? As a side question, why does the filename change when you enable content?
If I enable content then I can't rely on setting the the destination workbook as "Book1" as I imagine if another Excel workbook is open then the filename will change to "Book2"?
2. The sheetname is unique, e.g. "Freexxxx" so I can reference that as well. I wish to copy this to a named worksheet in my macro-enabled. Let's say my workbook is called "FreexxxxCalculator", I presume I'll need the full filename including the file type? e.g. .xlsm. to drill down further I will also like it to be copied over to the worksheet "Calc_Data".
3. I am then able to perform the macro and the calculations which are done on the "Calculator" worksheetname.
4. So once the calculation table is done I then wish to copy this to the original workbook "$Freexxxx" or Book 1 and save as a normal workbook rather than a macro-enabled workbook.
5. ensure the Calculaton workbook is never saved so that everytime the calculation is run it will always calculate new source data.
Putting it simply I wish to copy data from the downloaded workbook (which can have two different filenames depending on enable content) to the calculator workbook - where I run a macro to delete all unnecessary rows (which I've done), apply the data in columns and rows to the Calculator (which I've done) and the end result is to have the original source data and the calculation table in a single workbook on two separate tabs and ensure the calculator workbook closes without saving so the template is untouched.
I hope the above makes sense and I'll appreciate any help!
Thanks,
Last edited: