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

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

Forum statistics

Threads
1,223,897
Messages
6,175,271
Members
452,628
Latest member
dd2

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