using VBA code to change pivot filters based on cell values

Erin9903

New Member
Joined
Mar 21, 2018
Messages
6
I have a worksheet with 5 different pivots tables, 4 from one source, and 1 from another source. I've mapped in my service director (SD) last names into both sources.
Here are the names of the pivot tables.

Summary
AllInvoices
Top10
Buckets
Unbilled

When I change the SD last name from a dropdown in cell A1, I want it to control the SD filters on the 5 different pivots. The field name in all the pivots, no matter the source, is SD.
I know I need to add code to the tab, which I have done below

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Address = "$A$1" Then
        Call SDnames
    End If
End Sub
I just can't get the SDnames macro to do the right thing. This doesn't work

Code:
Sub SDnames()
'
' SDnames Macro
'


'
    Range("B4") = Range.Value(A1)
    Range("B13") = Range.Value(A1)
    Range("F13") = Range.Value(A1)
    Range("A1:H1").Select
End Sub


view
here is a picture of the worksheet. Due to data sensitivity, I cannot share the workbook.
https://drive.google.com/open?id=0Bx...BheTVlSlJtdmFz

Thank you for any assistance you can offer.
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

Forum statistics

Threads
1,215,011
Messages
6,122,677
Members
449,092
Latest member
tayo4dgacorbanget

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top