I'm trying to use this worksheetfunction in a Macro w/no luck...any ideas?
(I initially recorded a macro to get the correct "GetPivotData" elements and altered)
here is the partial/relevant code
My code stops at the Temp = line...and says "Object doesn't support this property or method"
(I initially recorded a macro to get the correct "GetPivotData" elements and altered)
here is the partial/relevant code
Code:
Dim Temp as Variant
.
.
For i = 6 To LR
If Range("C" & i) <> "" Then
Temp = WorksheetFunction.GetPivotData("Counts", Sheets(2).Range("A7"), "Year Resolved", Range("B" & i), "Year UW", Range("C" & i))
If Not IsNumeric(Temp) Then
Range("E" & i) = 0
Else
Range("E" & i) = Temp
End If
End If
Next i