Công thức = RemoveSpecial([Chuỗi])
Thực hiện: Alt-F11 >> Insert Module >> Chèn đoạn Code sau:
Function RemoveSpecial(Chuoi As String) As String Dim i As Integer Dim Kytu As String Dim Ketqua As String Ketqua = "" For i = 1 To Len(Chuoi) Kytu = Mid(Chuoi, i, 1) If Kytu = "-" Or Kytu = "_" Or Kytu = "(" Or Kytu = ")" Or Kytu = " " Then Ketqua = Ketqua Else Ketqua = Ketqua & Kytu End If Next RemoveSpecial = Ketqua End Function
No comments:
Post a Comment