Consulting

Results 1 to 4 of 4

Thread: Pivot find and replace

  1. #1
    VBAX Regular
    Joined
    Apr 2016
    Posts
    9
    Location

    Pivot find and replace

    Hello

    I need some help with a few pivots I am creating using vba.

    I'm facing the following issues with my pivots:

    1) Not being able to sort in descending order basis the values in the grand total. I have tried using the recorded code as well as written code on my own, but it does not seem to work
    2) I want to replace certain values within the pivots. But I can't be sure of the position of these values. I think find and replace would work, but I am not sure on how to put them in the code.

    code is in the excel file. I can't attach the data, since its confidential. I have attached the pivot without the source, to show my problem.

    Please help.

    Attaching the file for reference.
    Attached Files Attached Files

  2. #2
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,844
    right-click on center header, choose More Sort options…
    Capture3.JPG
    then:
    Capture4.JPGYou won't be allowed to change values, only labels.
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  3. #3
    VBAX Regular
    Joined
    Apr 2016
    Posts
    9
    Location
    Thanks p45cal but i need to do this through vba.

    any thoughts?

  4. #4
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,844
    Here's the macro I recorded:
    Sub Macro1()
        ActiveSheet.PivotTables("PivotTable1").PivotFields("center").AutoSort xlDescending, "Count of center"
    End Sub
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •