Hi Guys
I am attempting to create a Macro which will create a pivot. I intend to place a button on the screen so others can run it.
I have researched the net and come up with the following solution
FianlRow = Cells(Rows.Count, 1).End(xlUp).Row![]()
Please Login or Register to view this content.
DataSheet = ActiveSheet.Name
NewSheet = ActiveSheet.Name
ActiveCell.Offset(39, 1).Range("A1").Select
Sheets.Add
NewSheet = ActiveSheet.Name
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
DataSheet & "!R2C1:R & FinalRow & C17", Version:=xlPivotTableVersion14). _
CreatePivotTable TableDestination: NewSheet & "!R3C1", TableName:="PivotTable2",
DefaultVersion:=xlPivotTableVersion14
Sheets(NewSheet).Select
[/CODE]![]()
Please Login or Register to view this content.
Then carries on with the actual manipulation within the pivot. This part does not work for me. I have not found a solution in this forum but I am sure that you will immediately see where the problem is. I got this from http://www.youtube.com/watch?v=UkPxhlW9Hd0
Have uploaded the file.
Any suggestions would be great.
Thanks
Mark
Bookmarks