求excel中VBA代码,将A列数据每四个一组复制到B C D E列
3个回答
展开全部
Sub 复制()
n = Application.WorksheetFunction.CountA(Range("A:A"))
For i = 1 To Application.WorksheetFunction.RoundUp(n / 4, 0)
arr = Range("A" & (i - 1) * 4 + 1 & ":A" & (i - 1) * 4 + 4)
Range(Chr(65 + i) & "1:" & Chr(65 + i) & "4") = arr
Next
End Sub
最多只能复制到Z列
n = Application.WorksheetFunction.CountA(Range("A:A"))
For i = 1 To Application.WorksheetFunction.RoundUp(n / 4, 0)
arr = Range("A" & (i - 1) * 4 + 1 & ":A" & (i - 1) * 4 + 4)
Range(Chr(65 + i) & "1:" & Chr(65 + i) & "4") = arr
Next
End Sub
最多只能复制到Z列
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询