Adding new data columns in pivot table

happyzap

New Member
Joined
Feb 21, 2007
Messages
9
Greetings,
My first question in the great fourm. I have a pivot table, excel 2007, with four columns of data. The table was generated with the macro recorder and it works fine. What I want to do is generate the pivot table after I add more columns in the sheet where the data is pulled from when I click on the button that runs the pivot table macro. When I add the columns the range data in the macro needs to change accordingly. Any ideas? Thanks.

Happyzap
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
In general, you'll want to change source data reference from a specific range of cells, to a dynamic reference.

You can do that by :
1. using the .CurrentRegion property; or
2. using the data range (A1:LastRow,LastColumn) found with .Find method; or
3. using a named range for your Pivot Table source data

If you post your macro, that will make it easier to help you with suggest edits.
 
Upvote 0
JS411,
Thanks for the help. I am not sure what the procedure is to post my recorded macro so being aware of proper protocol I will post it if you would explain the process. Again, thanks for the reply

Happyzap
 
Upvote 0
I am not sure what the procedure is to post my recorded macro so being aware of proper protocol I will post it if you would explain the process.

The Formum Posting Guidelines explains how to post your code.
http://www.mrexcel.com/forum/showthread.php?t=515787

Tip #6 in particular explains how to put "code tags" around your code so that it is more readable.

Code:
With Code Tags around your code 
   It will look like this
End With 
 
If you indent your code Then
    it will be more readable and _
        you might get more responses
End If
 
Upvote 0

Forum statistics

Threads
1,224,603
Messages
6,179,850
Members
452,948
Latest member
UsmanAli786

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top