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!
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 | ||||||
---|---|---|---|---|---|---|
B | C | D | E | |||
1 | ||||||
2 | ||||||
3 | Zeilenbeschriftungen | Anzahl von Name/First name | ||||
4 | Alesi Angela | 1 | ||||
5 | Alesi Laura | 3 | ||||
6 | Alexa Cosmin Dacian | 18 | ||||
7 | Alexa Radu Andrei | 1 | ||||
8 | Alexandru Adrian Florin | 27 | ||||
9 | Amarfei Vladut Georgel | 26 | ||||
10 | Amaricai Cosmin Ionut | 19 | ||||
11 | Anastasiei Dragos Bogdan | 1 | ||||
12 | Andriu Florin Alexandru | 19 | ||||
13 | Antal Alexandru Antonin | 27 | ||||
14 | Anton Sebastian Dumitru | 10 | ||||
15 | Antone Ionica Adrian | 3 | ||||
16 | Apetrei Denisa Ionela | 3 | ||||
17 | Apetrei Doru Dumitru | 3 | ||||
18 | Arnaut Sergiu | 12 | ||||
19 | Avadanei Alin Gabriel | 15 | ||||
Tabelle2 |