dgavilanes
Member
Hi All,
I created a macro but it does not work, attached is the code.
What is supposed to do from a master dropdown box is syncronized the other drown down boxes, what it cannot do is deselect the previous selection and select a new value.
the eror message reads as follows. run-time error 1004
application-defined or object-defined error, please help!!!
Sub mastpvt()
'
' mastpvt Macro
'
'
ActiveSheet.PivotTables("pvt1").PivotFields("NICKNAME").CurrentPage = Range("E1").Text
With ActiveSheet.PivotTables("pvt1").PivotFields("NICKNAME")
.PivotItems("MAY").Visible = True
.PivotItems("ADDAMS").Visible = False
End With
ActiveSheet.PivotTables("pvt2").PivotFields("NICKNAME").CurrentPage = Range("E1").Text
With ActiveSheet.PivotTables("pvt2").PivotFields("NICKNAME")
.PivotItems("MAY").Visible = True
.PivotItems("ADDAMS").Visible = False
End With
ActiveSheet.PivotTables("pvt3").PivotFields("NICKNAME").CurrentPage = Range("E1").Text
With ActiveSheet.PivotTables("pvt3").PivotFields("NICKNAME")
.PivotItems("MAY").Visible = True
.PivotItems("ADDAMS").Visible = False
End With
ActiveSheet.PivotTables("pvt4").PivotFields("NICKNAME").CurrentPage = Range("E1").Text
With ActiveSheet.PivotTables("pvt4").PivotFields("NICKNAME")
.PivotItems("MAY").Visible = True
.PivotItems("ADDAMS").Visible = False
End With
I created a macro but it does not work, attached is the code.
What is supposed to do from a master dropdown box is syncronized the other drown down boxes, what it cannot do is deselect the previous selection and select a new value.
the eror message reads as follows. run-time error 1004
application-defined or object-defined error, please help!!!
Sub mastpvt()
'
' mastpvt Macro
'
'
ActiveSheet.PivotTables("pvt1").PivotFields("NICKNAME").CurrentPage = Range("E1").Text
With ActiveSheet.PivotTables("pvt1").PivotFields("NICKNAME")
.PivotItems("MAY").Visible = True
.PivotItems("ADDAMS").Visible = False
End With
ActiveSheet.PivotTables("pvt2").PivotFields("NICKNAME").CurrentPage = Range("E1").Text
With ActiveSheet.PivotTables("pvt2").PivotFields("NICKNAME")
.PivotItems("MAY").Visible = True
.PivotItems("ADDAMS").Visible = False
End With
ActiveSheet.PivotTables("pvt3").PivotFields("NICKNAME").CurrentPage = Range("E1").Text
With ActiveSheet.PivotTables("pvt3").PivotFields("NICKNAME")
.PivotItems("MAY").Visible = True
.PivotItems("ADDAMS").Visible = False
End With
ActiveSheet.PivotTables("pvt4").PivotFields("NICKNAME").CurrentPage = Range("E1").Text
With ActiveSheet.PivotTables("pvt4").PivotFields("NICKNAME")
.PivotItems("MAY").Visible = True
.PivotItems("ADDAMS").Visible = False
End With