PC Review


Reply
Thread Tools Rate Thread

Auto Update Pivot Table Help

 
 
=?Utf-8?B?RXhjZWwgUm9va2ll?=
Guest
Posts: n/a
 
      11th Mar 2007
Hi
I got tired of keep create the new pivot table every time there're new data
in the sheet. Therefore, I use the following code in the macro to update but
it keeps giving an error '!UpdateIt' cannot be found ??? ~ PLS HELP !

Sub Auto_Open()
Application.OnSheetActivate = "UpdateIt"
End Sub

Sub UpdateIt()
Dim iP As Integer
Application.DisplayAlerts = False
For iP = 1 To ActiveSheet.PivotTables.Count
ActiveSheet.PivotTables(iP).RefreshTable
Next
Application.DisplayAlerts = True
End Sub

Thanks,
Excel Rookie
 
Reply With Quote
 
 
 
 
=?Utf-8?B?Sm9lbA==?=
Guest
Posts: n/a
 
      11th Mar 2007
Why not just call it

Sub mytest()
Call UpdateIt
End Sub

"Excel Rookie" wrote:

> Hi
> I got tired of keep create the new pivot table every time there're new data
> in the sheet. Therefore, I use the following code in the macro to update but
> it keeps giving an error '!UpdateIt' cannot be found ??? ~ PLS HELP !
>
> Sub Auto_Open()
> Application.OnSheetActivate = "UpdateIt"
> End Sub
>
> Sub UpdateIt()
> Dim iP As Integer
> Application.DisplayAlerts = False
> For iP = 1 To ActiveSheet.PivotTables.Count
> ActiveSheet.PivotTables(iP).RefreshTable
> Next
> Application.DisplayAlerts = True
> End Sub
>
> Thanks,
> Excel Rookie

 
Reply With Quote
 
Tom Ogilvy
Guest
Posts: n/a
 
      11th Mar 2007
Where is the Updateit macro located. Is it in a general module
(insert=>Module) in the VBE?

with both subs in a general module, it worked fine for me. The code ran
whenever I selected a different sheet.

--
Regards,
Tom Ogilvy



"Excel Rookie" <Excel (E-Mail Removed)> wrote in message
news:28898F18-27F0-412E-A8D6-(E-Mail Removed)...
> Hi
> I got tired of keep create the new pivot table every time there're new
> data
> in the sheet. Therefore, I use the following code in the macro to update
> but
> it keeps giving an error '!UpdateIt' cannot be found ??? ~ PLS HELP !
>
> Sub Auto_Open()
> Application.OnSheetActivate = "UpdateIt"
> End Sub
>
> Sub UpdateIt()
> Dim iP As Integer
> Application.DisplayAlerts = False
> For iP = 1 To ActiveSheet.PivotTables.Count
> ActiveSheet.PivotTables(iP).RefreshTable
> Next
> Application.DisplayAlerts = True
> End Sub
>
> Thanks,
> Excel Rookie



 
Reply With Quote
 
=?Utf-8?B?RXhjZWwgUm9va2ll?=
Guest
Posts: n/a
 
      12th Mar 2007
Thanks Joel & Tom. It works now. I changed the name of the sub procedure.

"Excel Rookie" wrote:

> Hi
> I got tired of keep create the new pivot table every time there're new data
> in the sheet. Therefore, I use the following code in the macro to update but
> it keeps giving an error '!UpdateIt' cannot be found ??? ~ PLS HELP !
>
> Sub Auto_Open()
> Application.OnSheetActivate = "UpdateIt"
> End Sub
>
> Sub UpdateIt()
> Dim iP As Integer
> Application.DisplayAlerts = False
> For iP = 1 To ActiveSheet.PivotTables.Count
> ActiveSheet.PivotTables(iP).RefreshTable
> Next
> Application.DisplayAlerts = True
> End Sub
>
> Thanks,
> Excel Rookie

 
Reply With Quote
 
=?Utf-8?B?SmF5bmVlZHNoZWxw?=
Guest
Posts: n/a
 
      19th Apr 2007
I am tring to do a similar thing can you help?
I amrunnig a SQL querry in excel based on the now() function and - 24H.
My SQL querry updates just fine but my pivot table doenot update and I get a
print out of old data. How do I pivot table to update? Where and how do I
put the update function in my excel report?

Will this update also update the value() function? That function changes
text into a number that my pivot table uses.

"Tom Ogilvy" wrote:

> Where is the Updateit macro located. Is it in a general module
> (insert=>Module) in the VBE?
>
> with both subs in a general module, it worked fine for me. The code ran
> whenever I selected a different sheet.
>
> --
> Regards,
> Tom Ogilvy
>
>
>
> "Excel Rookie" <Excel (E-Mail Removed)> wrote in message
> news:28898F18-27F0-412E-A8D6-(E-Mail Removed)...
> > Hi
> > I got tired of keep create the new pivot table every time there're new
> > data
> > in the sheet. Therefore, I use the following code in the macro to update
> > but
> > it keeps giving an error '!UpdateIt' cannot be found ??? ~ PLS HELP !
> >
> > Sub Auto_Open()
> > Application.OnSheetActivate = "UpdateIt"
> > End Sub
> >
> > Sub UpdateIt()
> > Dim iP As Integer
> > Application.DisplayAlerts = False
> > For iP = 1 To ActiveSheet.PivotTables.Count
> > ActiveSheet.PivotTables(iP).RefreshTable
> > Next
> > Application.DisplayAlerts = True
> > End Sub
> >
> > Thanks,
> > Excel Rookie

>
>
>

 
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
auto update my pivot table rodchar Microsoft Excel Misc 0 26th Mar 2009 02:25 AM
Auto Update a Pivot Table johnsail Microsoft Excel Misc 1 10th Mar 2009 07:27 AM
Pivot Table Auto Update? mkaake Microsoft Excel Misc 0 21st Sep 2004 04:38 PM
Pivot Table Auto Update? mkaake Microsoft Excel Misc 1 21st Sep 2004 04:21 PM
Auto update of Pivot table K. Georgiadis Microsoft Excel Misc 1 2nd Jul 2004 05:21 PM


Features
 

Advertising
 

Newsgroups
 


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