|
楼主 |
发表于 2012-5-14 09:54
|
显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
本帖最后由 52UEXCEL 于 2012-5-15 21:48 编辑
ub fill()
Dim sht1 As Worksheet
Dim sht2 As Worksheet
Set sht1 = Worksheets("A")
Set sht2 = Worksheets("B")
n = sht2.Range("A65536").End(xlUp).Row + 1
sht2.Cells(n, 1) = sht1.Range("I3")
sht2.Cells(n, 2) = sht1.Range("J3")
sht2.Cells(n, 3) = sht1.Range("K3")
sht2.Cells(n, 4) = sht1.Range("l3")
sht2.Cells(n, 5) = sht1.Range("m3")
sht2.Cells(n, 6) = sht1.Range("N3")
sht2.Cells(n, 7) = sht1.Range("O3")
sht2.Cells(n, 8) = sht1.Range("P3")
sht2.Cells(n, 9) = sht1.Range("Q3")
sht2.Cells(n, 10) = sht1.Range("R3")
sht2.Cells(n, 11) = sht1.Range("S3")
sht2.Cells(n, 12) = sht1.Range("T3")
sht2.Cells(n, 13) = sht1.Range("U3")
sht2.Cells(n, 14) = sht1.Range("V3")
sht2.Cells(n, 15) = sht1.Range("W3")
sht2.Cells(n, 16) = sht1.Range("X3")
sht2.Cells(n, 17) = sht1.Range("Y3")
For i = 1 To 12
sht2.Cells(n + i, 1) = sht1.Cells(i + 3, "I")
sht2.Cells(n + i, 2) = sht1.Cells(i + 3, "J")
sht2.Cells(n + i, 3) = sht1.Cells(i + 3, "K")
sht2.Cells(n + i, 4) = sht1.Cells(i + 3, "L")
sht2.Cells(n + i, 5) = sht1.Cells(i + 3, "M")
sht2.Cells(n + i, 6) = sht1.Cells(i + 3, "N")
sht2.Cells(n + i, 7) = sht1.Cells(i + 3, "O")
sht2.Cells(n + i, 8) = sht1.Cells(i + 3, "P")
sht2.Cells(n + i, 9) = sht1.Cells(i + 3, "Q")
sht2.Cells(n + i, 10) = sht1.Cells(i + 3, "R")
sht2.Cells(n + i, 11) = sht1.Cells(i + 3, "S")
sht2.Cells(n + i, 12) = sht1.Cells(i + 3, "T")
sht2.Cells(n + i, 13) = sht1.Cells(i + 3, "U")
sht2.Cells(n + i, 14) = sht1.Cells(i + 3, "V")
sht2.Cells(n + i, 15) = sht1.Cells(i + 3, "W")
sht2.Cells(n + i, 16) = sht1.Cells(i + 3, "X")
sht2.Cells(n + i, 17) = sht1.Cells(i + 3, "Y")
Next i
End Sub
====================
工作中实际在用,速度有些慢.
|
|