excel vba快速填充公式:往下拉
答案:2 悬赏:0 手机版
解决时间 2021-03-29 11:53
- 提问者网友:不要迷恋哥
- 2021-03-29 08:27
excel vba快速填充公式:往下拉
最佳答案
- 五星知识达人网友:老鼠爱大米
- 2021-03-29 08:40
Sub 快速填充7行()
Dim k As Long,m As Long
k = Range("K65536").End(xlUp).Row
bm = Range("BM65536").End(xlUp).Row
With Range("K" & k)
.AutoFill Destination:=Range(.Address, .Offset(7, 0))
End With
With Range("BM" & bm)
.AutoFill Destination:=Range(.Address, .Offset(7, 0))
End With
End Sub K列和BM列的末尾行一致的话,可以使用同一变量。
追问只是填充我K列,其它列都没有填充,是什么回事呢追答定义变量应为bm,不是m,失礼了。
Sub 快速填充7行()
Dim k As Long, bm As Long
k = Range("K65536").End(xlUp).Row
bm = Range("BM65536").End(xlUp).Row
With Range("K" & k)
.AutoFill Destination:=Range(.Address, .Offset(7, 0))
End With
With Range("BM" & bm)
.AutoFill Destination:=Range(.Address, .Offset(7, 0))
End With
End Sub追问还是错了
现在是K列和bm列
中间哪些列没有追答Sub 快速填充7行()
Dim iCloumn As Integer, lastRow As Long
For iCloumn = 11 To 65
lastRow = Cells(60000, iCloumn).End(xlUp).Row
With Cells(lastRow, iCloumn)
.AutoFill Destination:=Range(.Address, .Offset(7, 0))
End With
Next
End Sub
Dim k As Long,m As Long
k = Range("K65536").End(xlUp).Row
bm = Range("BM65536").End(xlUp).Row
With Range("K" & k)
.AutoFill Destination:=Range(.Address, .Offset(7, 0))
End With
With Range("BM" & bm)
.AutoFill Destination:=Range(.Address, .Offset(7, 0))
End With
End Sub K列和BM列的末尾行一致的话,可以使用同一变量。
追问只是填充我K列,其它列都没有填充,是什么回事呢追答定义变量应为bm,不是m,失礼了。
Sub 快速填充7行()
Dim k As Long, bm As Long
k = Range("K65536").End(xlUp).Row
bm = Range("BM65536").End(xlUp).Row
With Range("K" & k)
.AutoFill Destination:=Range(.Address, .Offset(7, 0))
End With
With Range("BM" & bm)
.AutoFill Destination:=Range(.Address, .Offset(7, 0))
End With
End Sub追问还是错了
现在是K列和bm列
中间哪些列没有追答Sub 快速填充7行()
Dim iCloumn As Integer, lastRow As Long
For iCloumn = 11 To 65
lastRow = Cells(60000, iCloumn).End(xlUp).Row
With Cells(lastRow, iCloumn)
.AutoFill Destination:=Range(.Address, .Offset(7, 0))
End With
Next
End Sub
全部回答
- 1楼网友:野味小生
- 2021-03-29 09:49
For i = 2 to 7 &&7改成65536
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯