#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 83
Default Pivot Macro

Hi,

I have two sheets in excel,

sheet1 is the source data, where the count of the data keep changes.
sheet2 is the pivot sheet, where pivot is allready created.

I need a excel macro code, to update my pivot every day, when i run macro.
Update means, As in sheet1 the count of row keep changing the macro first it
should check the count in sheet1 then, the macro should update the same row
count in pivot.
Macro should do the changes in existing pivot, it should not create a new
pivot.

Please help me...




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,480
Default Pivot Macro

Hi

Instead of using a fixed range as the source for your PT, use a Dynamic
range.
InsertNameDefineName myData Refers to =
Sheet1!$A$1:INDEX(Sheet1!$1:$65536,COUNTA(Sheet1!$ A:$A),COUNTA(Sheet1!$1:$1))

Then refer to the named range myData in your macro
--
Regards
Roger Govier

"Ranjit kurian" wrote in message
...
Hi,

I have two sheets in excel,

sheet1 is the source data, where the count of the data keep changes.
sheet2 is the pivot sheet, where pivot is allready created.

I need a excel macro code, to update my pivot every day, when i run macro.
Update means, As in sheet1 the count of row keep changing the macro first
it
should check the count in sheet1 then, the macro should update the same
row
count in pivot.
Macro should do the changes in existing pivot, it should not create a new
pivot.

Please help me...




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Pivot Macro

Try the code below
copy and Paste the code in new module

Option Explicit

Sub ShowDates()
Dim pt As PivotTable
Dim ws As Worksheet
Set ws = Worksheets("Pivot")
Set pt = ws.PivotTables(1)

pt.PivotCache.Refresh
End Sub


Vishwanath N


*** Sent via Developersdex
http://www.developersdex.com ***
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
macro for a pivot anu Excel Discussion (Misc queries) 2 August 11th 06 04:48 PM
Pivot + Macro hurriance[_2_] Excel Programming 1 March 7th 06 12:15 PM
Pivot...and macro. Alex[_26_] Excel Programming 3 February 17th 06 05:02 PM
Steps from Macro recorder for Pivot table will not run as a Macro Nancy[_5_] Excel Programming 0 April 2nd 04 10:33 PM
pivot macro Tony Excel Programming 2 January 28th 04 12:03 AM


All times are GMT +1. The time now is 02:59 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"