ComboBox drop-down not clearing out old values

BakerUK

New Member
Joined
Nov 19, 2015
Messages
28
Hi,

On my Workbook Open code I first clear the combo values then loop through all the pivot items in a pivot field to generate the new list (this is after pivot has refreshed, so items can vary each time).

However, some old values are still showing up which no longer exist in the pivot. The pivot table is linked to an Access query.

Can anyone help me to remove the old values?

Thanks

Baker
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Did you clear combobox before filling it with values?
Code:
ComboBox1.Clear
 
Upvote 0
Did you clear combobox before filling it with values?
Code:
ComboBox1.Clear

Yes, it clears beforehand. I've stopped the code at that point and the drop-down is blank. It then loops through the pivot table items and the old values are included.

The old values are definitely not in the query anymore, but must somehow still be saved in the pivot items?? I could probably delete the pivot table and re-build it but this is an automated weekly report so I don't want the manual step.

Thanks for any help on this one.
 
Upvote 0
Well, when you run your code step-by-step (F8), couldn't you verify, which values go to combobox?
 
Upvote 0
Well, when you run your code step-by-step (F8), couldn't you verify, which values go to combobox?

Fair point, I've just done that and stepping through I can see that these old values are still PivotItems in my PivotField but I don't know what to do to prevent it? When I go to the pivot table itself, and drop-down the field in question, the old values are not showing there. But when the code runs they are.
 
Upvote 0

Forum statistics

Threads
1,213,534
Messages
6,114,186
Members
448,554
Latest member
Gleisner2

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