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
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