A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Charts and Charting
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Pivot Table - Change / Format Legend Names



 
 
Thread Tools Display Modes
  #1  
Old September 25th, 2009, 05:57 PM posted to microsoft.public.excel.charting
kuhrty
external usenet poster
 
Posts: 6
Default Pivot Table - Change / Format Legend Names

I created a pivot table graph. I have a ranking field that appear
concatenated like
{color} 1 - Confused
{color} 2 - Ugh

I need to change to
{color} Confused
{color} Ugh

Using this code below, I can format the string but the Name is not
updating

Dim m as Integer
Dim strmk As String
Dim iLen As Integer

For m = 1 To ActiveChart.SeriesCollection.Count
iLen = Len(ActiveChart.SeriesCollection(m).Name)
strmk = (Mid(ActiveChart.SeriesCollection(m).Name, 4,
iLen))
ActiveChart.SeriesCollection(m).Name = "bob"
Next m
  #2  
Old September 25th, 2009, 09:51 PM posted to microsoft.public.excel.charting
Herbert Seidenberg
external usenet poster
 
Posts: 1,113
Default Pivot Table - Change / Format Legend Names

Excel 2007 PivotTable, PivotChart
Change the PT data headers instead:
Sub NameChange()
Dim s As String
Dim n As Integer
With ActiveSheet.PivotTables(1)
For n = 1 To .DataFields.Count
s = .DataFields(n).Name
s = Replace(s, "Sum of ", "_")
..DataFields(n).Name = s
Next n
End With
End Sub

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:00 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.