Hi all,
I'm attempting to write a macro that puts data into a pivottable automatically. This seems pretty simple, but I can't quite figure it out. I think there is a problem with the name of the table and location its going to? I'm not to sure. I'm getting the Run-time error '1004' Application-defined or object-defined problem. Thank you for the help. Here is the code:
Sub RegEd()
'
' RegEd Macro
'
' Keyboard Shortcut: Ctrl+q
'
Application.CutCopyMode = False
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"Table1", Version:=6).CreatePivotTable TableDestination:="Sheet1!R4C22", _
TableName:="PivotTable4", DefaultVersion:=6
Sheets("Sheet1").Select
Cells(4, 22).Select
With ActiveSheet.PivotTables("PivotTable4")
Thanks again
I'm attempting to write a macro that puts data into a pivottable automatically. This seems pretty simple, but I can't quite figure it out. I think there is a problem with the name of the table and location its going to? I'm not to sure. I'm getting the Run-time error '1004' Application-defined or object-defined problem. Thank you for the help. Here is the code:
Sub RegEd()
'
' RegEd Macro
'
' Keyboard Shortcut: Ctrl+q
'
Application.CutCopyMode = False
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"Table1", Version:=6).CreatePivotTable TableDestination:="Sheet1!R4C22", _
TableName:="PivotTable4", DefaultVersion:=6
Sheets("Sheet1").Select
Cells(4, 22).Select
With ActiveSheet.PivotTables("PivotTable4")
Thanks again