Hi Skip,
This worked perfectly. I hadn't realized that I could loop through each datafield with the For Each call. My previous macros were explicitly stating the datafield name which could get pretty tedious.
Thanks!
Carl
I use pivot tables in Excel XP extensively. When creating the pivot table through the wizard, excel 'automatically' determines how to summarize the data (either SUM or COUNT). I frequently use AVERAGE and have yet to find a way to set a default summarization type. Has anyone found a way to...
Figured out my own question. Adding code as follows fixed the problem:
prows = resultsheet.UsedRange.Rows.Count
ActiveWorkbook.PivotCaches.add(SourceType:=xlDatabase, SourceData:= _
"Results!A1:AJ" & prows).CreatePivotTable TableDestination:="", TableName:= _...
I am creating a pivot table in which the data source (on a sheet named "results") has a variable number of rows. I can hard code the number of rows but would prefer to just refer to the 'used range' instead. The statement calling the pivot table currently looks like this...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.