[算表] VBA按钮输出值新首发问

楼主: kid78 (kid)   2016-08-17 16:37:28
软件: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
作者: zh20338   2016-08-17 16:38:00
noon noon赞!
作者: soyoso (我是耀宗)   2016-08-17 17:47:00
range.copy的方式试试 http://imgur.com/NgdsxSi另外请问noon noon赞是什么?
楼主: kid78 (kid)   2016-08-17 21:06:00
感谢神手回复,noon是朋友要自创的品牌,哈哈

Links booklink

Contact Us: admin [ a t ] ucptt.com