User selects the data source file and data is pulled from the pivot tables to populate a table in another workbook.
My problem is in the pivot table data used step...
I wanted "[SourceFile]" To indicated the data should be pulled from the file the user selected however my chart is populated with #n/a in these fields.
Thanks!
Code:
Dim SourceFolderLocation As String
Dim FileName As String
Dim SourceFile As VariantMsgBox "Please select the data source file..."
SourceFolderLocation = "C\Users\UserName\Desktop"
ChDrive SourceFolderLocation
SourceFile = Application.GetOpenFilename( _
fileFilter:="Excel Files (*.xls*), *.xls*", MultiSelect:=False)
Workbooks.Open (SourceFile)
Sheets("CRA_ActCost_PIVOT").Select
'This is the template
Windows("TestFile.xlsx").Activate
'Pivot table data that is used
Range("C28").Select
ActiveCell.FormulaR1C1 = _
"=GETPIVOTDATA(""Value"",'[SourceFile]PIVOT'!R3C1,""Team/Branch"",""DataPoint"",""Row Descrption"",""DataPoint2"",""Type"",""Transfer"")"
My problem is in the pivot table data used step...
I wanted "[SourceFile]" To indicated the data should be pulled from the file the user selected however my chart is populated with #n/a in these fields.
Thanks!