Created
May 21, 2013 06:08
-
-
Save sharapeco/5617768 to your computer and use it in GitHub Desktop.
半角カナを全角に、全角英数字を半角にだいたい変換する関数 Excel 用
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Private Function NormalizeString(ByVal source As Variant) As Variant | |
Dim i As Integer | |
Dim c As Variant | |
Dim result As Variant | |
result = "" | |
For i = 1 To Len(source) | |
c = StrConv(source, vbWide) | |
If Mid(c, i, 1) Like "[A-z]" Or Mid(c, i, 1) Like "[0-9]" Or Mid(c, i, 1) Like "-" Then | |
result = result & StrConv(Mid(c, i, 1), vbNarrow) | |
Else | |
result = result & Mid(c, i, 1) | |
End If | |
Next i | |
NormalizeString = result | |
End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment