Dim st As String st = "テスト" Dim Letter As String Dim i As Integer For i = 1 To Len(st) Letter = Mid(st, i, 1) If Letter Like "[!0-9a-zA-Z]" Then MsgBox "半角英数ではない文字があります。" Exit For End If Next i
If Len(st) > 8 Then MsgBox "8文字までです。" End If