View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
ecctse ecctse is offline
external usenet poster
 
Posts: 5
Default Creating pivot table with VBA

Hi,

I am trying to create a pivot tables using VBA with different number of rows
of source data. How can I supply the number of rows as a parameter to the
following method:

ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData:="???"

It seems it doesn't like me to supply a string variable to the SourceData,
for example, SourceData:= strRange

Any other method to get around? Thanks.