Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Sue Sue is offline
external usenet poster
 
Posts: 285
Default Excel 2007 Macro specific table to generic table?

I have a statement below with "PivotTable5" - How do I make that a generic
pivot table to where it would work with any pivot highlighted?

With ActiveSheet.PivotTables("PivotTable5").PivotFields ("Sum of Duration")
.Calculation = xlPercentOfColumn
.NumberFormat = "0%"
--
Sue
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,480
Default Excel 2007 Macro specific table to generic table?

Hi Sue

Try
With
ActiveSheet.PivotTables(1).PivotFields("Sum of Duration") _
.Calculation = xlPercentOfColumn
.NumberFormat = "0%"
End With


Assuming there is only 1 pivot table on the active sheet
--
Regards
Roger Govier

"Sue" wrote in message
...
I have a statement below with "PivotTable5" - How do I make that a generic
pivot table to where it would work with any pivot highlighted?

With ActiveSheet.PivotTables("PivotTable5").PivotFields ("Sum of Duration")
.Calculation = xlPercentOfColumn
.NumberFormat = "0%"
--
Sue


  #3   Report Post  
Posted to microsoft.public.excel.misc
Sue Sue is offline
external usenet poster
 
Posts: 285
Default Excel 2007 Macro specific table to generic table?

Roger,
I have two pivots on the active sheet. I want to highlight the pivot value
area and then change the format. Is there any way to make the selected pivot
(generic - any active pivotTable) the only one I will change the format?--
Sue


"Roger Govier" wrote:

Hi Sue

Try
With
ActiveSheet.PivotTables(1).PivotFields("Sum of Duration") _
.Calculation = xlPercentOfColumn
.NumberFormat = "0%"
End With


Assuming there is only 1 pivot table on the active sheet
--
Regards
Roger Govier

"Sue" wrote in message
...
I have a statement below with "PivotTable5" - How do I make that a generic
pivot table to where it would work with any pivot highlighted?

With ActiveSheet.PivotTables("PivotTable5").PivotFields ("Sum of Duration")
.Calculation = xlPercentOfColumn
.NumberFormat = "0%"
--
Sue


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,480
Default Excel 2007 Macro specific table to generic table?

Hi Sue

The following appears to work fine for me when I select a cell within the PT
first

Dim myname As String

With ActiveSheet
myname = ActiveCell.PivotTable()
End With
With ActiveSheet.PivotTables(myname).PivotFields("Sum of Duration") _
.Calculation = xlPercentOfColumn
.NumberFormat = "0%"
End With

--
Regards
Roger Govier

"Sue" wrote in message
...
Roger,
I have two pivots on the active sheet. I want to highlight the pivot value
area and then change the format. Is there any way to make the selected
pivot
(generic - any active pivotTable) the only one I will change the format?--
Sue


"Roger Govier" wrote:

Hi Sue

Try
With
ActiveSheet.PivotTables(1).PivotFields("Sum of Duration") _
.Calculation = xlPercentOfColumn
.NumberFormat = "0%"
End With


Assuming there is only 1 pivot table on the active sheet
--
Regards
Roger Govier

"Sue" wrote in message
...
I have a statement below with "PivotTable5" - How do I make that a
generic
pivot table to where it would work with any pivot highlighted?

With ActiveSheet.PivotTables("PivotTable5").PivotFields ("Sum of
Duration")
.Calculation = xlPercentOfColumn
.NumberFormat = "0%"
--
Sue


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
how to create pivot table from existing pivot table in excel 2007 Udayraj Dhulekar Excel Discussion (Misc queries) 2 July 8th 13 08:22 PM
Change a specific code to generic in VB macro Sue Excel Discussion (Misc queries) 2 April 23rd 08 06:56 PM
Does table have at least one row in Excel 2007? nickol Excel Discussion (Misc queries) 4 March 3rd 08 06:57 AM
Pivot Table in Excel 2007 : Problem with % in Table spudsnruf Excel Discussion (Misc queries) 2 January 9th 08 09:53 PM
Creation of a Generic Macro Sondra Excel Worksheet Functions 1 September 13th 05 10:40 PM


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