I am trying to rename a worksheet, however the name of the worksheet that is reffered to in my code is more than 31 characters long i am trying to achieve the outcome of the code bellow.
MyNameLen = Application.WorksheetFunction.Len(MyName)
If MyNameLen > 30 Then
MyName = Application.WorksheetFunction.Left(MyName, 30)
End If
MyNameLen = Application.WorksheetFunction.Len(MyName)
If MyNameLen > 30 Then
MyName = Application.WorksheetFunction.Left(MyName, 30)
End If