我需要一個輸入框來詢問允許輸入的最大數量的打印份數。Excel輸入框最多可打印多少份副本
我有下面的代碼,但它的工作原理,但如果我輸入大於「1」,它觸發
If NumberOfCopies >= "11" Then
,如果我點擊取消按鈕,它也引發了同樣的事情
'ASKS HOW MANY COPIES TO PRINT
PRINTS:
Dim NumberOfCopies As String
NumberOfCopies = Application.InputBox("How many copies do you want to print? Must enter 0-10", Type:=2)
If NumberOfCopies >= "11" Then
MsgBox "Max to print is 10 copies"
GoTo PRINTS
End If
If NumberOfCopies = "0" Or NumberOfCopies = "" Then
'do not print
Else
ActiveSheet.PrintOut Copies:=NumberOfCopies
End If
CINT(NumberOfCopies)> = 11 –
當我運行它,你有它的方式,它正確評估。在輸入框中輸入1將移動if語句作爲「1」<「11」。 – Rdster