This code works great for creating worksheets from a list. However some names on the list are longer than the 31 characters allowed. Is there a way to edit this code to truncate the name if larger than 31 characters?
Sub AddWorksheetsFromSelection() Dim CurSheet As Worksheet Dim Source As Range Dim c As Range Set CurSheet = ActiveSheet Set Source = Selection.Cells Application.ScreenUpdating = False For Each c In Source sName = Trim(c.Text) If Len(sName) > 0 Then Worksheets.Add After:=Worksheets(Worksheets.Count) ActiveSheet.Name = sName End If Next c CurSheet.Activate Application.ScreenUpdating = True End Sub
Bookmarks