Validation list to update a pivot table

olympiac

Board Regular
Joined
Sep 26, 2010
Messages
158
I have got a pivot table that will be updated with the value of a Validation list that contains the following dates:
December-2010
January-2011
February-2011
March-2011
April-2011
If the user chooses the value April-2011 (for which I do not have data in my pivot), is it possible to get a Msgbox saying that the data is not available for April 2011 instead of updating the pivot table with an inexisting value?
If I choose April-2011 the code below updates the pivot table overwriting the value March-2011
Here is the code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim PT10 As PivotTable
'---------------------Date Raised---------------------------------------------
If Not Intersect(Target, Range("B3")) Is Nothing Then
Set PT10 = Sheets("Pivot_data").PivotTables("PivotTable_Client")
PT10.PivotFields("Date Raised").CurrentPage = Sheets("Dashboard").Range("B3").Value
Set PT10 = Nothing
End If
End Sub
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

Forum statistics

Threads
1,224,597
Messages
6,179,813
Members
452,945
Latest member
Bib195

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