Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Automatic update

Hello

I want to update a pivot table when a cell is changed.

Sub Oppdater()
' Oppdate Makro
' Oppdate pivot
'
Private Sub date_Change()
' Oppdate if change

Range("B8").Select
ActiveSheet.PivotTables("Pivottabell1").PivotCache .Refresh
End Sub


--


Jakob
http://www.pointshop.no/austgulen
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Automatic update

Select the sheet tab which you want to work with. Right click the sheet tab
and click on 'View Code'. This will launch VBE. Paste the below code to the
right blank portion. Get back to to workbook and try out.

Check out the date cell in the below code it is B8
Check out the name of the table "PivotTable1" and adjust to suit

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Not Application.Intersect(Target, Range("B8")) Is Nothing Then
ActiveSheet.PivotTables("PivotTable1").PivotCache. Refresh
Application.EnableEvents = True
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Jakob" wrote:

Hello

I want to update a pivot table when a cell is changed.

Sub Oppdater()
' Oppdate Makro
' Oppdate pivot
'
Private Sub date_Change()
' Oppdate if change

Range("B8").Select
ActiveSheet.PivotTables("Pivottabell1").PivotCache .Refresh
End Sub


--


Jakob
http://www.pointshop.no/austgulen

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default Automatic update

right click the sheet tab and select 'View Code' and then paste the following
code. It uses the sheet's CHANGE event to trap when an entry has been made.
If the cell changed is the one you want, then the pt is refreshed...


Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = Range("B9").Address Then
Worksheets("Sheet1").PivotTables(1).PivotCache.Ref resh
End If

End Sub


"Jakob" wrote:

Hello

I want to update a pivot table when a cell is changed.

Sub Oppdater()
' Oppdate Makro
' Oppdate pivot
'
Private Sub date_Change()
' Oppdate if change

Range("B8").Select
ActiveSheet.PivotTables("Pivottabell1").PivotCache .Refresh
End Sub


--


Jakob
http://www.pointshop.no/austgulen

Reply
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
Automatic update of filter claudia Excel Discussion (Misc queries) 1 June 5th 09 01:13 AM
Automatic Update for Date txdude1 Excel Discussion (Misc queries) 3 December 18th 08 07:59 PM
Automatic update of spreadsheet & automatic update between workboo Losva Excel Worksheet Functions 6 September 12th 08 03:22 PM
Automatic Update Chuck Charts and Charting in Excel 1 June 9th 06 07:34 PM
Automatic update LLoraine Excel Discussion (Misc queries) 3 February 24th 06 08:57 PM


All times are GMT +1. The time now is 11:54 PM.

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

About Us

"It's about Microsoft Excel"