+ Reply to Thread
Results 1 to 2 of 2

Changing Pivot Table Field Name

  1. #1
    Carmen
    Guest

    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. #2
    Datasort
    Guest

    RE: 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, Before:=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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1