软件:Excel for Mac
版本:2016
各位算表神神手大家好,小弟有个问题想请教大家
图1
http://imageshack.com/a/img923/3720/bkhtRi.png
小弟想在图1上建立一个按钮,
按下按键后可将商品资讯跟价格输出到另一个页签图2
图2
http://imageshack.com/a/img924/2539/QvyZzg.png
但我目前只能输出一行的商品资讯,请教各位大师该如何解决,感谢:)
附上只会一行的程式码
Sub 结帐()
If Sheets("Day").Range("a2") = "" Then
r = 2
Else
r = Sheets("Day").Range("a1").End(xlDown).Row + 1
End If
'date
Sheets("Day").Cells(r, "a") = Range("d14")
'product
Sheets("Day").Cells(r, "b") = Range("a2")
'price
Sheets("Day").Cells(r, "c") = Range("b2")
'quantity
Sheets("Day").Cells(r, "d") = Range("c2")
'total price
Sheets("Day").Cells(r, "e") = Range("d2")
'people
Sheets("Day").Cells(r, "f") = Range("d15")
Range("a2:a11") = ""
Range("b2:b11") = ""
Range("c2:c11") = ""
Range("e2:e11") = ""
MsgBox "Have a NOON day!!"
End Sub