Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Changing Pivot Table Field Name

Hi,

I noticed that no matter how I change the name of a field in Pivot, when I
look at field properties I still see the original field name. Is there a
way to get the original field name? I want to constantly change the caption
of that particular field.

I want to change the name of a field from month to month (ie Sept Cost, Oct
Cost). I would request the user to input the month in an input box, but how
do I change the field? It's impossible to say replace "Sept Cost" with "Oct
Cost" because I do not keep track of the field index and won't know the
original name.

Thanks,
Carmen


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Changing Pivot Table Field Name

First of all, I would not use an input box but a form that has a combo box
attached that makes the user select a field that is valid. The user might
type Oct Costs or October costs which are different column heading names to
the pivot table.

I would be a create a custom tool bar that would have the drop down months
that are valid

Set myControl = CommandBars("Custom").Controls _
.Add(Type:=msoControlComboBox, Befo=1)
With myControl
.AddItem Text:="Jan Costs", Index:=1
.AddItem Text:="Feb Costs", Index:=2
€¦

.DropDownLines = 3
.DropDownWidth = 75
.ListHeaderCount = 0
End With

Do a search on CommandBarComboBox in the vba help to get a feel for setting
up the command bar combo box

Secondly, I would use the macro recorder to show what kind of code is needed
to remove a month and add a new month. Then use the change event of the combo
box do the changes for the macro recorder.

Best of luck
--
Stewart Rogers
DataSort Software, L.C.


"Carmen" wrote:

Hi,

I noticed that no matter how I change the name of a field in Pivot, when I
look at field properties I still see the original field name. Is there a
way to get the original field name? I want to constantly change the caption
of that particular field.

I want to change the name of a field from month to month (ie Sept Cost, Oct
Cost). I would request the user to input the month in an input box, but how
do I change the field? It's impossible to say replace "Sept Cost" with "Oct
Cost" because I do not keep track of the field index and won't know the
original name.

Thanks,
Carmen


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
Changing a field setting in a pivot table The Rook[_2_] Excel Discussion (Misc queries) 3 September 5th 08 05:29 PM
Changing field names without affecting pivot table csdjj Excel Discussion (Misc queries) 2 April 15th 08 05:16 PM
Changing a pivot table field items to current database Pete Straman Straman via OfficeKB.com Excel Programming 3 February 22nd 05 04:40 PM
Changing field in Pivot Table with macro hans Excel Programming 0 June 23rd 04 09:17 AM
Dynamically changing a calculated field in Pivot Table Rick[_19_] Excel Programming 4 November 7th 03 04:46 AM


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