ユーザーから番号を取得する入力ボックスを使用しています。許可されていない入力を避けたいのですが、負の数で立ち往生しています。処理する必要がある唯一の入力は、1 から 500 までの整数です。-1 がまだトリガーされる理由がわかりません。これまでの私のコードは次のとおりです。
LBefore = InputBox("lines?", "", ">>> insert number <<<", 11660, 9540)
Select Case StrPtr(LBefore)
Case 0
'Cancel pressed
Exit Sub
Case Else
If (LBefore <> "") Then
'Check for numeretical value
If IsNumeric(LBefore) Then
cijfer = Abs(CByte(LBefore))
'Check to see if value is in allowed range
If (cijfer >= 1) And (cijfer <= 500) Then
'do stuff ...
end If
End If
End If
End Select