VBA Copy/Paste from PivotTable to regular table

Rhodan

New Member
Joined
Jul 3, 2008
Messages
6
Hi folks,

See this as a cry for help from a noob, hoping you can help me with the following VBA/Macro question

I am trying to piece together a macro which will copy data from a pivot table into a regular table at the click of a button

Source:
Worksheet name: Import_Skill
Pivottable name: PivotTable1
Pivottable type: Report type set to Tabular Report

Destination:
Worksheet name: Table
Tablename: Table1

Table1 has the same column headernames as the pivot table.

Basically what I am trying to do is copy the data from the tabular pivot table as values only in the regular table , in the next available empty row.
I've been at this for hours now and I am either hopelessly over-engineering this ( with nothing to show for it ) or just hopeless fullstop :biggrin:

Any help would be welcomed!
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Not being able to look at your table I think this should work in case it does not you need to play with the offset

Code:
Sub VCPFPTRT()


LastRow = Sheets("Table").ListObjects("Table1").Range.Find(What:="*", SearchOrder:=xlRows, _
    SearchDirection:=xlPrevious, LookIn:=xlValues).Row
    
TC = Sheets("Table").ListObjects("Table1").ListColumns(1).Range.Column


Sheets("Import_Skill").PivotTables("PivotTable1").TableRange2.Offset(4, 0).Copy
Sheets("Table").Cells(LastRow + 1, TC).PasteSpecial xlPasteValues


End Sub
 
Upvote 0

Forum statistics

Threads
1,223,898
Messages
6,175,272
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