Hi,
I've got a spreadsheet that i need to run a pivot from every night. The spreadsheet is created on a daily basis and the amount of rows in it will change everytime.
I've recorded myself pivoting the data and get this
Sub tektips()
Range("A3:M89"
.Select
Range("M89"
.Activate
ActiveSheet.PivotTableWizard SourceType:=xlDatabase, SourceData:= _
"'Sols Not Instructed'!R3C1:R89C13", TableDestination:="", TableName:= _
"PivotTable1"
ActiveSheet.PivotTables("PivotTable1"
.AddFields RowFields:= _
"Probate Controller", ColumnFields:="Day's until Sols Instructed Due"
ActiveSheet.PivotTables("PivotTable1"
.PivotFields("Name and Address"
. _
Orientation = xlDataField
End Sub
But the problem is that the number of rows to be included changes everytime.
Does anybody have any suggestions how i can change this code to accomodate changes in row numbers or an alternative suggestion??
I've got a spreadsheet that i need to run a pivot from every night. The spreadsheet is created on a daily basis and the amount of rows in it will change everytime.
I've recorded myself pivoting the data and get this
Sub tektips()
Range("A3:M89"
Range("M89"
ActiveSheet.PivotTableWizard SourceType:=xlDatabase, SourceData:= _
"'Sols Not Instructed'!R3C1:R89C13", TableDestination:="", TableName:= _
"PivotTable1"
ActiveSheet.PivotTables("PivotTable1"
"Probate Controller", ColumnFields:="Day's until Sols Instructed Due"
ActiveSheet.PivotTables("PivotTable1"
Orientation = xlDataField
End Sub
But the problem is that the number of rows to be included changes everytime.
Does anybody have any suggestions how i can change this code to accomodate changes in row numbers or an alternative suggestion??