Thread: getPivotData
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
KyWilde KyWilde is offline
external usenet poster
 
Posts: 15
Default getPivotData

I am trying to use a variable in the GetPivotData function and I keep getting
#REF error. Here is my syntax:
Cells(lRow, 5).Select
ActiveCell.FormulaR1C1 = _
"=GETPIVOTDATA(""Sum of
xfers"",Pivot_table!R3C1,""day"",DATE(2005,3,29)"

When I try:
Cells(lRow, 5).Select
ActiveCell.FormulaR1C1 = _
"=GETPIVOTDATA(""Sum of xfers"",Pivot_table!R3C1,""day"",temp3)"

using temp3, a variable holding a date, it gives me a #REF error. Can I not
use variables here? What can I do to make this dynamic?

Thanks.