Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
check if value exists in pivot table
I have a macro that inserts the value of the active cell into cell A1 of the
same worksheet. Pivot tables on other worksheets are then filtered by that value. Now I need to write some error handling so that if the value of the active cell is not contained in the pivot table, it exits the procedure. Here is the code I have so far. Private Sub Worksheet_SelectionChange(ByVal Target As Range) Application.ScreenUpdating = False If ActiveCell.Value = "" Then Exit Sub Else 'insert project name (value of column A of active row) into cell A1 Range("A1") = Cells(ActiveCell.Row, "A").Value 'insert staff name (value of column B of active row) into cell A2 Range("A2") = Cells(ActiveCell.Row, "B").Value 'refresh all pivot tables ThisWorkbook.RefreshAll End If Application.ScreenUpdating = True End Sub Any help would be greatly appreciated. - Mica |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to check Pivot Table source? | New Users to Excel | |||
If Pivot Table Exists, Delete on Close | Excel Programming | |||
Determine If Pivot Table Exists | Excel Programming | |||
If Pivot Table Exists | Excel Programming | |||
How can I use VBA ADO to check if a table exists in an Access DB? | Excel Programming |