軟體: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