Excel VBA, how to create a macro that creates a PivotTable from 1 data sheet from another workbook

Armien7

New Member
Joined
Nov 18, 2021
Messages
13
Office Version
  1. 365
Platform
  1. Windows
Hi everyone, I hope you are all doing well!

I need some help with a macro that I'm trying to make.

Every month I get a data sheet named 'Mutaties' from a few customers, which I then turn in to a Pivot Table. Tho when doing this for 30 customers.. it gets repetitive.

I'm trying to build a macro button in 1 workbook (Workbook name: 'Macro Knop voor Auditfiles', worksheet name: 'Macro Knop') that turns the data in the other workbook (workbook: 'AuditFile', worksheet: 'Mutaties') in to a PivotTable. With the following 3 filters, in the rows: 'grootboekrekeningnaam', 'grootboekrekeningcode'. And 'saldo' as values. I have some attachments for clarification.

There will always only be 2 workbooks open, 1 with the macro button (which I click on the start the macro) and 1 workbook with the data from my customer (which I like to turn in to a PivotTable). Once the PivotTable is ready I save and close it to go to the next data sheet to repeat the same process).

I hope some of you have some tips / tricks for me, I would love to hear them. It would help me out lotss! :)

I want to wish everyone a wonderfull weekend!

Cheers,

Armin
 

Attachments

  • Knipsel.PNG
    Knipsel.PNG
    17.2 KB · Views: 26
  • Macro knop auditfiles.PNG
    Macro knop auditfiles.PNG
    94.6 KB · Views: 21

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

Forum statistics

Threads
1,224,823
Messages
6,181,179
Members
453,021
Latest member
Justyna P

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