Generate the sheets from a pivot table automatically

g3org

Board Regular
Joined
Jul 25, 2021
Messages
69
Office Version
  1. 365
Platform
  1. Windows
Hello everyone, any chances to create the sheets from a pivot table automatically? Now i am doing DoubleClick on each value to create it and am using this code to rename each one based on a cell's value and i was wondering if this can be done easier..?
Sub tabname()
Dim ws As Worksheet
For Each ws In Worksheets
On Error Resume Next
If Len(ws.Range("B4")) >0 Then
ws.Name = Replace(ws.Range("B4").Value,"/","-")
End If
On Error Goto 0
If ws.Name <> Replace(ws.Range("B4").Value,"/","-") Then
Msgbox ws.Name & " Was Not renamed, the suggested name was invalid"
End If
Next
End Sub

Thanks in advance!

WH_08_22_Mihalache-Pitret_Sandu.xlsx
BCDE
1
2
3ZeilenbeschriftungenAnzahl von Name/First name
4Alesi Angela1
5Alesi Laura3
6Alexa Cosmin Dacian18
7Alexa Radu Andrei1
8Alexandru Adrian Florin27
9Amarfei Vladut Georgel26
10Amaricai Cosmin Ionut19
11Anastasiei Dragos Bogdan1
12Andriu Florin Alexandru19
13Antal Alexandru Antonin27
14Anton Sebastian Dumitru10
15Antone Ionica Adrian3
16Apetrei Denisa Ionela3
17Apetrei Doru Dumitru3
18Arnaut Sergiu12
19Avadanei Alin Gabriel15
Tabelle2
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Forum statistics

Threads
1,223,997
Messages
6,175,874
Members
452,679
Latest member
darryl47nopra

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