Public Function IsSheetNameValid(sheetName As String) As Boolean ' Test the name passed as a string to see if it is a valid sheet name IsSheetNameValid = False ' Establish default If Len(sheetName) = 0 Then Exit Function If Len(sheetName) > 31 Then Exit Function Dim InvalidCharacters As Variant InvalidCharacters = Array("/", "\", "[", "]", "*", "?", ":") Dim X As Integer For X = LBound(InvalidCharacters) To UBound(InvalidCharacters) If InStr(sheetName, (InvalidCharacters(i))) > 0 Then Exit Function Next IsSheetNameValid = True End Function