LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default Running a macro when a cell in a range has changed

Dose anyone know how to write this code....I need to refresh a pivottable
each time Cell A4 or A6 is changed...I tried the code below but it's not
working only updates on selection the cell rather that after the change has
been made

Thanks

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$A$4:$A$6" Then
Application.ScreenUpdating = False
TT = Range("Tab_Name")
Sheets(TT).Select
ActiveSheet.PivotTables("PivotTable2").PivotCache. Refresh
TR = Range("Rpt_Tab")
Sheets(TR).Select
Application.ScreenUpdating = True
End If
End Sub

--
Helping Is always a good thing
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to clear range contents when cell contents are changed by us Steve E Excel Programming 12 February 22nd 07 09:09 PM
Auto Running a macro when a field has changed RaY Excel Programming 3 September 1st 06 03:10 AM
stop a macro from running everytime a cell is changed bassfisher Excel Programming 4 October 6th 05 02:25 PM
stop from running everytime a cell is changed bassfisher[_4_] Excel Programming 6 October 3rd 05 09:12 PM
Automaticlly Running Macro on Changed Cell Chris Excel Programming 1 December 2nd 03 03:54 PM


All times are GMT +1. The time now is 06:21 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"