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

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

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