Data Validate List Does Not Update from Pivot Table (post refresh)

LiamMcg

New Member
Joined
Sep 2, 2021
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi, I looked through a number of previous posts but wasn't able to find a similar issue,

I've got a simple data validate list pulling from a pivot table, =OFFSET($AC$60,0,0,COUNTA($AC:$AC)-1) $AC$60 is my first row of the pivot table.

I've got a simple macro running that when you select the worksheet the pivot table refreshes

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Call RefreshMacro
End Sub


The issue I'm finding is when I refresh the pivot table, then select my cell with the drop down list it does not show the current refreshed items UNTIL I select a row just below the original selected row. After I click on any of the other rows, after the initial one (post refresh) it shows the current list.

Any advice?
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
I've got a simple macro running that when you select the worksheet the pivot table refreshes
What you say here isn't quite correct.
As your "refresh" call is placed in the Worksheet_selectionCHANGE event, then the refresh is trying to work each time you select a new cell in the sheet - including your data-validated cell.
I'm guessing that the refresh isn't always happening quickly enough to update your validation list.

I'm guessing that you actually want the refresh to occur when the worksheet becomes active; in this case it should go into the sheet's _activate event:
VBA Code:
Private Sub Worksheet_Activate()
Call RefreshMacro
End Sub
... even then, the refresh may not occur sufficiently quickly for the validation list to be updated in time for the user's click. In this case setting the query's "Background Query" property to false, with VBA (or unchecking the tickbox in the query's properties window), may help.
 
Last edited:
Upvote 0
Solution
Pleasure! Thanks for marking as the solution, and for the feedback. (y)
 
Upvote 0

Forum statistics

Threads
1,214,795
Messages
6,121,624
Members
449,041
Latest member
Postman24

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