Matching selections on pivot tables

R

RobinG

I am having a problem with some code. It worked fine, now I'm getting a
run-time error 1004. It's pretty simple, but I haven't been able to figure
out why it stopped working.

All it is supposed to do it match the selections from one pivot table to
another and clear several fields when the button is clicked.

Private Sub CommandButton2_Click()
Range("y1") = Range("i3")
Range("y2") = Range("i4")
Range("y3") = Range("i5")
Range("y4") = Range("i6")
Range("y5") = Range("i7")
Range("y6") = Range("i8")
Range("y7") = Range("i9")
Range("y8") = Range("i10")
Range("d6") = ""
Range("d7") = ""
Range("d8") = ""
Range("d9") = ""
Range("g6") = ""
Range("g10") = ""
Range("g9") = ""
Range("i41") = ""
Range("i42 ") = ""
Range("i43") = ""
Range("i40") = ""
Range("j36 ") = ""

End Sub


Columns I and Y are the page fields in two different pivot tables
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top