View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
cmungall cmungall is offline
external usenet poster
 
Posts: 5
Default Assigning values to Pivot field

I am using a macro to assign a value to a pivot field. We have a drop-down
menu that the user selects a value from and through a vlookup, the value that
is selected from the menu is then selected in a specific pivot field. Our
problem is that when the macro runs, instead of just selecting the selected
value from the list contained in the pivot field, it actually changes the
current value to the new "user selected" value!

How do I go about telling excel to select the value from the list instead of
overwriting the current selection?

Here is what the macro looks like as of right now...

Sub ClassDescriptionSync()

With ActiveSheet.PivotTables("ClassDescTbl1")
.ManualUpdate = True
.PivotFields("Class Description").CurrentPage =
ActiveSheet.Range("O2").Value
.ManualUpdate = False
End With

End Sub