Dim StudentName As String StudentName = "タナカ タロウ" Dim SafeStudentName As String Dim i As Integer Dim ZenkakuChar As String Dim StudentChar As String For i = 1 To Len(StudentName) 'i文字目のStudentName StudentChar = Mid(StudentName, i, 1) 'それを全角に変換したもの ZenkakuChar = StrConv(StudentChar, vbWide) '元の文字が全角に変換したものと同じなら、元の文字は全角(ということにする) If ZenkakuChar = StudentChar Then StudentChar = "?" End If SafeStudentName = SafeStudentName & StudentChar Next i MsgBox SafeStudentName