難しい質問が 1 つあります。「P プラス 4 桁の乱数」を入力するのはユーザーだけです。
*(eg:P1234) *into inputbox は、有効なコードが入力されるまで実行されない限り、有効なコードと見なされ、マクロの実行を停止します。私はほぼ完了したと思いますが、まだほとんど問題はありません.Hereは私のコードです:
Sub asd()
Dim strcode As String
Dim strnumber As string
strcode = InputBox("what is your production code?")
Do Until strcode = InStr(1, strcode, "P",vbBinaryCompare) And Len(strcode) = 5 _
and strnumber = Mid(strcode, 2) and IsNumeric (strnumber)
strcode = InputBox("what is your production code?")
Loop
End Sub
どうもありがとうございました!!