Hi
I have the following code
The variable in cell J11 will be Average, but the section of the code " & Ch1 & " should read xlAverage.
I'm getting the run-time error 1004 at the moment.
I want this to be a variable
(I know that if they change the Average to Sum etc, then the piece of code that says Average of Cost should read Sum of Cost etc)
Any help???
I have the following code
Code:
Dim Ch1 As Excel.Range
Set Ch1 = Range("J11")
ActiveSheet.PivotTables("PivotTable1").PivotFields("Average of Cost").Function = " & Ch1 & "
The variable in cell J11 will be Average, but the section of the code " & Ch1 & " should read xlAverage.
I'm getting the run-time error 1004 at the moment.
I want this to be a variable
(I know that if they change the Average to Sum etc, then the piece of code that says Average of Cost should read Sum of Cost etc)
Any help???