0
有什麼方法可以使這項工作我一直在試圖找出幾個小時。有不同數量的單元格增量範圍VBA
我試圖在循環中使用偏移,但我還沒有得到它的工作 例如我用X = x.Offset(10,0)和i = i.Offset(5,0)等等
Sub Macro5()
Dim i As Range, j As Range, k As Range
Dim x As Range, y As Range
Dim Num As Integer
Num = 94
Set x = Sheets("Sum Data").Range("B1:G10")
Set j = Sheets("PNA Physical Needs Summary Data").Range("C4:L9")
Set i = Sheets("PNA Physical Needs Summary Data").Range("B4:B9")
Set k = Sheets("Sum Data").Range("A1")
Set p = Sheets("PNA Physical Needs Summary Data").Range("P3:P8")
Set e = Sheets("PNA Physical Needs Summary Data").Range("A4:A9")
Do
x.Copy
j.Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
p.Copy i
k.Copy e
Num = Num - 1
Loop Until Num = 0
End Sub
回去檢查你對原始問題的評論:最好不要過早地提出新問題... – 2012-01-09 23:06:13
[VBA最好的方式來增加循環中最好的方法](http://stackoverflow.com/問題/ 8793782/VBA-什麼最最好的方式,以增量在環) – brettdj 2012-01-10 01:58:02