我对使用Select Case和字符串进行比较感到沮丧.
我只需要检查是否有人发表评论或者只是通过扫描不同的对象来继续.
所以我在声明中读到并检查是否有部件号进入(总是以N开头)或者如果不是,所以我知道接下来要去哪里.
由于接下来可能发生三种情况,我不能接受if temp = Left(temp, 1) = "N".
我的错误在哪里?
temp = Application.InputBox(Prompt:="Would you like to make a comment?" & vbCrLf & "If not please continue with next scan. ", Title:="Comment or go on", Type:=2)
Select Case temp
Case Is = Left(temp, 1) = "N"
'New scan - next number got scanned
MsgBox ("Controlmessage - N Case")
i = i + 1
.Cells(i, "D").Select
temp = ""
End Select
Run Code Online (Sandbox Code Playgroud)