Sharron,
I'm not sure about setting up the [Enter] key but find your subject macro in the
macro list & assign a shortcut under the [Options...] tab, i.e. I use [Shift] +
[Ctrl] + [q] for a lot of routines that I run.
Loa
________________________________
From: sheizageek <sheizageek@yahoo.com>
To: ExcelVBA@yahoogroups.com
Sent: Mon, May 23, 2011 1:18:34 PM
Subject: [ExcelVBA] Refreshing Pivot Tables
I have an Excel 2007 worksheet that has Source Data and a PivotTable on the same
worksheet. I have VBA code that works well to refresh a pivot table that is on a
separate worksheet, but doesn't work if the pivot table is on the same
worksheet.
Is there a way for the pivot table to refresh when the <Enter> key is pressed
after the source data is changed?
This is the code I am using if the PT is on a separate worksheet.
Private Sub Worksheet_Calculate()
Sheets("Sheet1").PivotTables("PivotTable1").RefreshTable
End Sub
Thanks
Sharron
[Non-text portions of this message have been removed]
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.
----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA
----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com
----------------------------------
Tidak ada komentar:
Posting Komentar