Hi,
I have set up a small macro to create a pivot table from a spreadsheet:
Sub CreatePivot()
'
' CreatePivot Macro
' Macro recorded 3/14/2007 by Gary
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatabase, SourceData:= _
"Data!R1C1:R656C90").CreatePivotTable TableDestination:="", TableName:= _
"PivotTable1", DefaultVersion:=xlPivotTableVersion10
ActiveSheet.PivotTableWizard TableDestination:=ActiveSheet.Cells(3, 1)
ActiveSheet.Cells(3, 1).Select
Sheets("Sheet1").Select
Sheets("Sheet1").Name = "Pivot"
End Sub
The problem is that each spreadsheet I run it on, has a different number of rows. They all have the same number of columns (A-CL), but the number of rows varies. I'd like the pivot to work no matter how many rows it is: i.e., that it will automatically select the entire range whatever it is. Is this doable
Thank you,
Gary