標題:
[發問]
將current year 的數字複製到last year
[打印本頁]
作者:
idsmchow
時間:
2012-4-29 01:06
標題:
將current year 的數字複製到last year
將Current year 的數字複製到Last year 的column, 直至出現 End 字樣為止.
請問那裡出錯, 應如何更正?
Sub Macro5()
B = 2
C = 2
D = 3
Do Until Sheets("Sheet1").Range(Cells(5, B), Cells(5, B)) = "End"
Sheets("Sheet1").Range(Cells(5, C), Cells(43, C)).Select
Selection.Copy
Sheets("Sheet1").Range(Cells(5, D), Cells(43, D)).Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
B = B + 1
C = C + 2
D = D + 2
Loop
End Sub
作者:
oobird
時間:
2012-4-29 08:43
Sub Macro5()
With Sheets("sheet1")
c = 2
Do Until .Cells(5, c) = "End"
.Range(.Cells(5, c + 1), .Cells(43, c + 1)) = .Range(.Cells(5, c), .Cells(43, c)).Value
c = c + 2
Loop
End With
End Sub
複製代碼
作者:
idsmchow
時間:
2012-4-29 23:52
回復
2#
oobird
謝謝回覆:)
歡迎光臨 麻辣家族討論版版 (http://forum.twbts.com/)