Hi, I have this code and it shows me "Object doesn't support this property or method" I dont know if anybody knows waht might be the mistake!
Sub Horror()
Call LastRowPivotTable
With ThisWorkbook
Set wb = ThisWorkbook
Set DR = wb.Sheets("Draft")
Set PT = wb.Sheets("Pivot Table I")
MasterAcct = wb.DR.Range("C4")
If wb.DR.Range("T7").Value = "1" Then
wb.PT.PivotFields("Master Account").ClearAllFilters
wb.PT.PivotFields("Master Account").CurrentPage = MasterAcct
Else
wb.PT.Range("B4:L & LastRowPivot").ClearContents
End If
End With
End Sub
This is the call I have
Sub LastRowPivotTable()
Dim ThisWK As String
ThisWK = ThisWorkbook.Name
LastRowPivot = Workbooks(ThisWK).Worksheets("Pivot Table I").Cells(Rows.Count, "B").End(xlUp).Row
End Sub
Thanks!
Sub Horror()
Call LastRowPivotTable
With ThisWorkbook
Set wb = ThisWorkbook
Set DR = wb.Sheets("Draft")
Set PT = wb.Sheets("Pivot Table I")
MasterAcct = wb.DR.Range("C4")
If wb.DR.Range("T7").Value = "1" Then
wb.PT.PivotFields("Master Account").ClearAllFilters
wb.PT.PivotFields("Master Account").CurrentPage = MasterAcct
Else
wb.PT.Range("B4:L & LastRowPivot").ClearContents
End If
End With
End Sub
This is the call I have
Sub LastRowPivotTable()
Dim ThisWK As String
ThisWK = ThisWorkbook.Name
LastRowPivot = Workbooks(ThisWK).Worksheets("Pivot Table I").Cells(Rows.Count, "B").End(xlUp).Row
End Sub
Thanks!