Dim Val As IntegerIf InputValue(Val, "输入数量", "请输入要添加的数量") Then If Val <> "" Then For i As Integer = 1 To val Dim r As Row = Tables("a表").AddNew() r("第二列") = "存货" r("第三列") = "仓库" Next Else msgbox("没有数量,不进行添加") End IfEnd If