View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Romanoff Romanoff is offline
external usenet poster
 
Posts: 5
Default Rename an Pivot Item

Hello

Question

I would like to change an pivot item in a pivot.
(Remark, the pivot is empty, no data in there.)

How i have to do it?

In the Example below i would like to rename the Name of the PivotItem
of the Field "ToA" as followed:
Name now: 8287 Result from Dep. Acc
Wished new name: 8287 Result depp acc


I've got it so far....

Sub Rename()
Dim Feld As PivotField
Dim Item As PivotItem
Dim Thepivot As PivotTable
Set Thepivot = ActiveSheet.PivotTables("RicPivot")

For Each Feld In Thepivot.PageFields
If Feld.Name = "ToA" Then
For Each Item In Feld.PivotItems 'Löschen Itemeinträge
If Item.Name = "8287 Result from Dep. Acc." Then
With Item

--Question
--Question reaname ? .Name = "8287 Result depp acc"
--Question

End With
End If
Next
End If
Next

End Sub


How can i assign the new name to the pivot item ?

Is it easier to delete an insert the name ? (delete the item is
simple, but insert a item name ?)


Kind regards,
Roman