【发布时间】:2017-11-24 05:54:13
【问题描述】:
这是我的代码:
qty = InputBox("Please enter the quantity to be added.", "Add Quantity")
Cells(row, 2) = qty
Description = InputBox("Please enter a description.", "Enter Description")
Cells(row, 3) = Description
Unitp = InputBox("Please enter a unit price.", "Enter UnitPrice")
Cells(row, 4) = Unitp
Amount = InputBox("Please enter an amount.", "Enter Amount")
Cells(row, 5) = Amount
Qty & Unitp 在 Excel 中正确显示。但是,当我在 Description 输入框中输入字符时,它会引发错误。但是如果我输入no。它通过但在 Excel 单元格中显示为FALSE。 Descripton 和 Amount 都是这种情况。
有人可以帮忙吗?
【问题讨论】:
-
Description是如何定义的? -
你写
Dim Description As Bool左右吗?