Gerald Crumbley
New Member
- Joined
- Oct 6, 2021
- Messages
- 8
- Office Version
- 365
- Platform
- Windows
I have a monthly report to produce, I have 51 .xlsx sheets to combine. I have found how to import all into different worksheets. I have found how to rename each worksheet to a cell value.
Problem: the tabs can only be 31 characters or less, or the script doesn't rename it.
Question: How can I cut the cell characters to 30 before running the rename script?
Below is my Tab Rename script. If I can add to this to cut the cells to 30, great. If I need to create a new macro, please let me know. Thanks for any advice or direction:
Sub RenameTabs()
Dim ws As Worksheet
For Each ws In Worksheets
On Error Resume Next
If Len(ws.Range("F5")) > 0 Then
ws.Name = ws.Range("F5").Value
End If
On Error GoTo 0
Next
End Sub
Problem: the tabs can only be 31 characters or less, or the script doesn't rename it.
Question: How can I cut the cell characters to 30 before running the rename script?
Below is my Tab Rename script. If I can add to this to cut the cells to 30, great. If I need to create a new macro, please let me know. Thanks for any advice or direction:
Sub RenameTabs()
Dim ws As Worksheet
For Each ws In Worksheets
On Error Resume Next
If Len(ws.Range("F5")) > 0 Then
ws.Name = ws.Range("F5").Value
End If
On Error GoTo 0
Next
End Sub