Function CleanExcel(text As String) As String Dim i As Long, result As String For i = 1 To Len(text) Select Case Asc(Mid(text, i, 1))Case 33 To 47, 58 To 64, 91 To 96, 123 To 126 '<-- valid characters in English alphabet 'do nothingCase 48 To 57 '<-- digits result = result & Mid(text, i, 1)Case 65 To 90 '<-- uppercase letters result = result & Mid(text, i, 1)Case 97 To 122 '<-- lowercase letters result = result & Mid(text, i, 1)Case Else result = result & " " '<-- replace invalid characters with space End Select Next i CleanExcel = result End Function