PC Review


Reply
Thread Tools Rate Thread

check if value exists in pivot table

 
 
Mica
Guest
Posts: n/a
 
      1st Apr 2010
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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Check that a table exists =?Utf-8?B?QWNjZXNzSGFy?= Microsoft Access External Data 1 20th Jul 2007 11:57 AM
If Pivot Table Exists =?Utf-8?B?aG9wcGVybXI=?= Microsoft Excel Programming 4 27th Jun 2006 05:47 PM
Check if a table exists =?Utf-8?B?dG9yY2hfbXVzaWM=?= Microsoft Access VBA Modules 5 4th Apr 2005 05:59 AM
Check if table exists Mike Davis Microsoft Access Macros 0 21st Aug 2003 10:11 PM
Re: Check if a table exists using VB Tim Ferguson Microsoft Access VBA Modules 0 24th Jul 2003 07:19 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:33 AM.