Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Code Will Not Run

I have a simple workbook that contains a pivot table worksheet. On that
worksheet I inserted the following code:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
ActiveSheet.PivotTables(2).PivotCache.Refresh

End Sub

It does not work. It does not appear to be executing at all. When excel
opens the workbook, I do not get a warning about macros. How do I fix this
to get the code to run?

S. Jackson


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Code Will Not Run

I just realized that I had the code wrong and changed it, but the code will
still not run. It will run just fine on the sample TimeChart.xls file I
downloaded from http://www.contextures.com/excelfiles.html#Pivot

Here is the code I have on the worksheet containing the pivot table (fyi,
the source table is on a different sheet):

Private Sub Worksheet_Activate()
ActiveSheet.PivotTables(1).PivotCache.Refresh
End Sub


"S Jackson" wrote in message
...
I have a simple workbook that contains a pivot table worksheet. On that
worksheet I inserted the following code:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
ActiveSheet.PivotTables(2).PivotCache.Refresh

End Sub

It does not work. It does not appear to be executing at all. When excel
opens the workbook, I do not get a warning about macros. How do I fix

this
to get the code to run?

S. Jackson




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
split post code (zip code) out of cell that includes full address Concord Excel Discussion (Misc queries) 4 October 15th 09 06:59 PM
Drop Down/List w/Code and Definition, only code entered when selec Spiritdancer Excel Worksheet Functions 2 November 2nd 07 03:57 AM
Create a newworksheet with VBA code and put VBA code in the new worksheet module ceshelman Excel Programming 4 June 15th 05 04:37 PM
stubborn Excel crash when editing code with code, one solution Brian Murphy Excel Programming 0 February 20th 05 05:56 AM
option buttons run Click code when value is changed via VBA code neonangel Excel Programming 5 July 27th 04 08:32 AM


All times are GMT +1. The time now is 04:18 AM.

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"