我需要使用值选择电子表格中的最后一行,然后将其向下拖放(包括公式)。我能够找到值的最后一行,但在选择最后一行时遇到了问题。
With Sheets("Data")
Dim LR1 As Long
LR1 = .Range("A" & .Rows.Count).End(xlUp).Row
.Range(LR1).Select
End With我只希望最后一行被选中并拖下1行。我没有尝试添加代码来向下拖放,因为我似乎无法选择最后一行数据。
发布于 2015-11-23 21:55:44
如果你想把你的最后一个细胞填充到它下面的细胞里,
Sub Data_Button1_Click()
Dim LR1 As Long
With Sheets("Data")
LR1 = .Range("A" & .Rows.Count).End(xlUp).Row
With .Range("A" & LR1)
.AutoFill Destination:=.Range("A1:A2")
End With
End With
End Sub发布于 2015-11-24 14:43:30
我能够用下面的代码来完成这个任务。谢谢大家的帮助。
Dim LR1 As Long
With Sheets("Auto Lease Data")
LR1 = .Range("A" & .Rows.Count).End(xlUp).Row
With .Range("A" & LR1 & ":ZZ" & LR1)
.AutoFill Destination:=.Range("A1:ZZ2"), Type:=xlFillDefault
End With
End Withhttps://stackoverflow.com/questions/33881279
复制相似问题