Skip to content

Instantly share code, notes, and snippets.

@longtth
Last active June 4, 2019 14:50
Show Gist options
  • Select an option

  • Save longtth/a7f2c8c468260de88e91bbfc7d34f950 to your computer and use it in GitHub Desktop.

Select an option

Save longtth/a7f2c8c468260de88e91bbfc7d34f950 to your computer and use it in GitHub Desktop.
Loại bỏ các kí tự không phải chữ & số (non-alpha-numeric) trong Excel
Function CleanCode(Rng As Range)
Dim strTemp As String
Dim n As Long
For n = 1 To Len(Rng)
Select Case Asc(Mid(UCase(Rng), n, 1))
Case 48 To 57, 65 To 90
strTemp = strTemp & Mid(UCase(Rng), n, 1)
End Select
Next
CleanCode = strTemp
End Function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment