Pivot table - Show Report Filter Pages - shortens tab names to 26 characters

gnosttam

New Member
Joined
Apr 28, 2017
Messages
1
Hello,

First time poster. Great website.

I have an issue with a Pivot table. I am using 'Show Report Filter Pages' function. I ensured that the tab names that would be populated have equal to or less than 31 characters (to abide by the 31-character limit). The problem is, when I use the function, it populates my tabs with only 26 characters and will truncate anything past the 26 characters. Has anyone come across this issue? Aside from shortening my tabs to 26 characters, is there a workaround to ensure that the full 31 character limit gets populated?

Thanks.
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Could do similar using a macro?

Code:
Public Sub ShowReportFilterPages()
  Dim wksSource As Worksheet
  Dim wksTarget As Worksheet
  Dim pvtTable As PivotTable
  Dim pvtField As PivotField
  Dim pvtItem As PivotItem
  
  On Error GoTo ErrHandler
  Set wksSource = ThisWorkbook.Sheets("SHEET NAME GOES HERE")
  Set pvtTable = wksSource.PivotTables("TABLE NAME GOES HERE")
  Set pvtField = pvtTable.PageFields("FIELD NAME GOES HERE")
  
  For Each pvtItem In pvtField.PivotItems
    Set wksTarget = ThisWorkbook.Sheets.Add
    wksTarget.Name = pvtItem.Value
    pvtField.CurrentPage = pvtItem.Value
    pvtTable.TableRange2.Copy wksTarget.Range("A1")
  Next pvtItem
  
TidyUp:
  Set wksSource = Nothing
  Set wksTarget = Nothing
  Set pvtTable = Nothing
  Set pvtField = Nothing
  Set pvtItem = Nothing
  Exit Sub
  
ErrHandler:
  MsgBox Err.Description, vbCritical, "Error " & Err.Number
  Resume TidyUp
End Sub
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,120
Members
451,399
Latest member
alchavar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top