Reputation: 53
Good day everyone!
I got run-time error 1004 pivot table field name is not valid in EXCEL
I have dynamic data range from Infolog Data!R2C1:R3800C24 is valid, on 1 pc it work on other 3 pc dosent work, and I can't understand why... Office 2013
Sub Creation_of_list_planning()
Application.DisplayAlerts = False
Sheets("Planning").Delete
Application.DisplayAlerts = True
Worksheets.Add After:=Worksheets(Worksheets.Count)
Worksheets(Worksheets.Count).Name = "Planning"
End Sub
In debug I got error in this part:
Sub Creation_of_table()
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"Infolog Data!R2C1:R3800C24", Version:=xlPivotTableVersion14).CreatePivotTable _
TableDestination:="Planning!R1C1", TableName:="Planning", DefaultVersion:= _
xlPivotTableVersion14
Upvotes: 1
Views: 4236
Reputation: 34045
Your SourceData command is missing some apostrophes required due to the spaces in the sheet name:
SourceData:= _
"'Infolog Data'!R2C1:R3800C24"
There also needs to be a valid header in A2:X2 on that sheet.
Upvotes: 2