zookeepertx
Well-known Member
- Joined
- May 27, 2011
- Messages
- 591
- Office Version
- 365
- Platform
- Windows
Hello all,
This is a weird situation! I have a macro that runs correctly on the sheet it was created for. I'm analyzing the coding to make sure I know exactly how it works in case I need to do the same action for something else.
What it does is to take the data sheet, break up the data according to 1 column that shows the Method of delivery, create a new sheet with a pivot table and a pivot chart for each method of delivery.
But when I make a copy of the sheet in a brand new workbook, the code runs but it creates a pivot table and pivot chart that encompass ALL of the data into 1 table and 1 chart.
I've tried running it from the macro menu at the top of the Excel window and directly from the Visual Basic window and the same thing happens either way. (Because I really don't "get" pivot tables and I'm looking at this as an example of creating them.
So, let's call the original workbook "A":
* The macro runs correctly on the sheet in that book
Say I copy that exact sheet into a new workbook - let's call it "B":
* The macro won't work correctly on the sheet
If I copy that same sheet straight from book "B" back into book "A":
* The macro works correctly
If I copy the sheet from book "B" into another new book - let's call it "C":
* The macro doesn't work correctly
I've tried saving "B" and "C" on my desktop as both a "plain" workbook and as a macro-enable workbook and it makes no difference.
So, it seems that it only wants to work correctly in that 1 book.
Anybody got an idea what might be causing such an odd thing?
Thanks!
Jenny
This is a weird situation! I have a macro that runs correctly on the sheet it was created for. I'm analyzing the coding to make sure I know exactly how it works in case I need to do the same action for something else.
What it does is to take the data sheet, break up the data according to 1 column that shows the Method of delivery, create a new sheet with a pivot table and a pivot chart for each method of delivery.
But when I make a copy of the sheet in a brand new workbook, the code runs but it creates a pivot table and pivot chart that encompass ALL of the data into 1 table and 1 chart.
I've tried running it from the macro menu at the top of the Excel window and directly from the Visual Basic window and the same thing happens either way. (Because I really don't "get" pivot tables and I'm looking at this as an example of creating them.
So, let's call the original workbook "A":
* The macro runs correctly on the sheet in that book
Say I copy that exact sheet into a new workbook - let's call it "B":
* The macro won't work correctly on the sheet
If I copy that same sheet straight from book "B" back into book "A":
* The macro works correctly
If I copy the sheet from book "B" into another new book - let's call it "C":
* The macro doesn't work correctly
I've tried saving "B" and "C" on my desktop as both a "plain" workbook and as a macro-enable workbook and it makes no difference.
So, it seems that it only wants to work correctly in that 1 book.
Anybody got an idea what might be causing such an odd thing?
Thanks!
Jenny