[354.xls] ' [mjSumple] のコード '■■ テキストボックスに数字以外入力できないようにする ■■ ' ' 'フォームを表示します Sub frmSumple_Show() 'フォームの表示 frmSumple.Show End Sub ' [frmSumple] のコード Private Sub txtInput_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger) 'ASC関数でASCIIコードを調べます。 'そしてその値が0〜9以外であれば、押されたキーを無効にする 'という処理です。 If KeyAscii < Asc("0") Or KeyAscii > Asc("9") Then KeyAscii = 0 End Sub