• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Pivot Tables sort

jassybun

Member
I want to add additional code to sort all the tables (table1-table6) in descending order of the date (the second column in the 2 column pivot table)

How can I add this in?

Code:
Sub SaveAsValues()

Dim WS As Worksheet


ActiveWorkbook.RefreshAll

Set WkShts = Sheets(Array("Overview", "Sheet1", "Sheet2", "Sheet3", "Sheet4", "Sheet5", "Sheet6"))

For Each WS In WkShts

  WS.UsedRange = WS.UsedRange.Value

Next WS


Set WkShts = Sheets(Array("Table1", "Table2", "Table3", "Table4", "Table5", "Table6"))

For Each WS In WkShts

WS.Cells.Borders.LineStyle = x1None

Range("A1").Select


Next WS


ThisWorkbook.SaveAs ThisWorkbook.Path & "\Month Report"


End Sub
 
Last edited:
I think it should look like this, but I am getting an issue of the property value

Code:
    ActiveSheet.PivotTables( ).PivotFields("W/E").AutoSort _
        xlDescending, "W/E"
 
Last edited:
Back
Top