Public Function Chk_機種依存(strTarget As String) As String
Dim strReturn As String
Dim intStrLen As Integer
Dim intChar As Integer
Dim i As Integer
intStrLen = Len(strTarget)
strReturn = vbNullString
For i = 1 To intStrLen
intChar = Asc(Mid(strTarget, i, 1))
If (intChar <= -30823 And intChar >= -30912) _
Or (intChar <= -1540 And intChar >= -4032) _
Or (intChar <= -949 And intChar >= -1472) _
Or intChar = -32322 Or intChar = -32321 _
Or intChar = -32282 Or intChar = 60 Or intChar = 62 _
Or (intChar <= 223 And intChar >= 161) Then
strReturn = strReturn & Chr(intChar)
ElseIf intChar = 9 Then strReturn = strReturn & "[tab]"
End If
Next i
If strReturn <> vbNullString Then strReturn = "【機種依存文字】以下の文字が使われています。修正して下さい。" & vbCrLf & strReturn
Chk_機種依存 = strReturn