如何复制范围和过去到最后一行
我在单元格E33:G33中有一个用户input事务信息(名称,金额,date)。
用户点击button,交易logging在从E46:G46开始的交易历史列表中使用的最后一行+1中。
到目前为止,我的代码不起作用。
我想要的只是:-copy range(E33:G33) – 查找列E中使用的最后一行 – 低一行 – 复制范围
不能find一个工作的答案,请帮助! 谢谢。
用这个:
Sub test() Dim e&: e = Cells(Rows.Count, "E").End(xlUp).Row + 1 Range("E" & e & ":G" & e).Value = [E33:G33].Value 'past only values End Sub
要么
Sub test2() Dim e&: e = Cells(Rows.Count, "E").End(xlUp).Row + 1 [E33:G33].Copy Range("E" & e & ":G" & e) 'past with cells format End Sub
要么
Sub test3() Dim e&: e = Cells(Rows.Count, "E").End(xlUp).Row + 1 [E33:G33].Copy Range("E" & e & ":G" & e).PasteSpecial xlPasteAll 'past with cells format End Sub
要么
Sub test4() Dim e&: e = Cells(Rows.Count, "E").End(xlUp).Row + 1 [E33:G33].Copy Range("E" & e & ":G" & e).PasteSpecial xlPasteValues 'past only values End Sub
也:
[E33:G33]
可以replace为:
Range("E33:G33")
要么
Cells(Cells(33,"E"),Cells(33,"G"))
要么
Cells(Cells(33,5),Cells(33,7))