jei eusebio
Member
Hi Ninjas,
I used this vba code and made a button for it to clear columns, i would just like to add a refresh pivot option to the command so that it would also refresh the pivot in the "Pivot" sheet. Thanks in advance guys!
Sub Clear_Stuff()
Dim lngLastRow As Long
With Worksheets("Raw")
lngLastRow = .Cells(.Rows.Count, 3).End(xlUp).Row
.Range("A:J").Clear
End With
With Worksheets("Main")
lngLastRow = .Cells(.Rows.Count, 3).End(xlUp).Row
.Range("B:E").Cells.ClearContents
End With
With Worksheets("Pivot")
lngLastRow = .Cells(.Rows.Count, 6).End(xlUp).Row
.Range("A4:H" & lngLastRow).Cells.ClearContents
End With
End Sub
I used this vba code and made a button for it to clear columns, i would just like to add a refresh pivot option to the command so that it would also refresh the pivot in the "Pivot" sheet. Thanks in advance guys!
Sub Clear_Stuff()
Dim lngLastRow As Long
With Worksheets("Raw")
lngLastRow = .Cells(.Rows.Count, 3).End(xlUp).Row
.Range("A:J").Clear
End With
With Worksheets("Main")
lngLastRow = .Cells(.Rows.Count, 3).End(xlUp).Row
.Range("B:E").Cells.ClearContents
End With
With Worksheets("Pivot")
lngLastRow = .Cells(.Rows.Count, 6).End(xlUp).Row
.Range("A4:H" & lngLastRow).Cells.ClearContents
End With
End Sub