How to make macro copy only most recent months data from a pivot?

Vipor3d

New Member
Joined
Nov 1, 2021
Messages
1
Office Version
  1. 2016
Platform
  1. Windows
I apologize if this is a dumb question, I'm just not that great with Excel. But I'm hoping to get better.

I'm currently trying to automate part of a process I do for my job that involves copying data from a pivot table and pasting it into another worksheet. However, the pivot table is setup to show cost data by month and each month the previous months costs get added to the pivot, and that's the data I need to copy. Only the most recent month. But I keep having the issue where the macro wants to copy the same column of data each time and not the most recent one. Is there a way to do this like I need?

Also, is there a way to account for additional rows showing in the pivot? For example, if there are 10 cost categories in the rows and then next month there are 12, can a macro be setup to capture all of the cost categories regardless of how many there are?
 

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

Forum statistics

Threads
1,214,601
Messages
6,120,460
Members
448,965
Latest member
grijken

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