Create a pivot table from database

mark84

New Member
Joined
Jan 22, 2021
Messages
29
Office Version
  1. 2016
Platform
  1. Windows
Hi everybody,
I have a DB like img1.
I d want to create a VBA code to create a pivot table with the fields in the img2.
The field "Somma di AVG PV" is a Calculated Field obtained from the database fields ratio =Imponibile/Qtaevasa.

Could you help me please?
Thank you!

Regards
Marco
 

Attachments

  • img1.PNG
    img1.PNG
    49.7 KB · Views: 5
  • img2.PNG
    img2.PNG
    6.4 KB · Views: 5

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
click record macro,
create your pivot.
then end macro.

The macro should work as long as you don't have an existing pivot in the workbook.
you may have to increase/decrease row counts before use if the data changes.
 
Upvote 0
Thanks for your answer but I’m looking for a vba code that is different from a recorde macro, that’s not dynamic.

could you help me with a dynamic solution?

thanks
 
Upvote 0

Forum statistics

Threads
1,215,006
Messages
6,122,666
Members
449,091
Latest member
peppernaut

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