+ Reply to Thread
Results 1 to 2 of 2

How to change value field setting (add new value) in multiple pivot tables with one slicer

  1. #1
    Registered User
    Join Date
    05-10-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    25

    How to change value field setting (add new value) in multiple pivot tables with one slicer

    Dear Experts,

    Need help in creating vba for pivot tables and slicer.

    I have multiple pivot tables in workbook and i want to change its value field setting simultaneously with one slicer. I got below code from google search and its worked for me. but it can be use for only one pivot table.
    I want it to use for multiple x pivot tables and on multiple sheets. I want to use two value fields for each pivot table (Acv in Crs and ACV in USD Mn)



    https://sites.google.com/site/e90e50...-or-powerpivot

    Private Sub Worksheet_PivotTableUpdate(ByVal Target As PivotTable)

    Dim ptMain As PivotTable
    Dim pfMeasure As CubeField
    Dim i As Long

    On Error GoTo Errorhandler

    Set ptMain = ThisWorkbook.Worksheets("Pivot").PivotTables("PivotTable1")

    For Each pfMeasure In ptMain.CubeFields
    If pfMeasure.Orientation = xlDataField Then
    pfMeasure.Orientation = xlHidden
    End If
    Next

    i = 0
    Do While [choice].Offset(i, 0).Value <> ""
    ptMain.AddDataField ptMain.CubeFields("[Measures].[" & [choice].Offset(i, 0).Value & "]")
    i = i + 1
    Loop

    Exit Sub

    Errorhandler:
    Debug.Print Now(), Err.Description

    End Sub

    kindly help
    Thanks you in advance

  2. #2
    Registered User
    Join Date
    05-10-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: How to change value field setting (add new value) in multiple pivot tables with one sl

    Kindly help to complete this

    Regards
    Vikas

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Change field(s) for all Pivot Tables in active sheet
    By lucazzo in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-19-2017, 09:26 AM
  2. [SOLVED] Run macro to change pivot table row field when user selected a slicer item
    By Chrispelletier in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-20-2016, 09:44 AM
  3. Change Pivot Table Column field on Slicer selection (Excel 2013)
    By kevboyo in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 10-27-2014, 11:36 PM
  4. Replies: 3
    Last Post: 02-13-2014, 04:32 PM
  5. [SOLVED] setting pivot filter in multiple pivot tables
    By Zealotwraith in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-31-2013, 09:32 AM
  6. Pivot tables - controlling display setting of grouped field
    By tonyph17 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-13-2012, 09:08 AM
  7. field setting help in pivot tables
    By aravindhan_31 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-20-2009, 06:11 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1