|
どちらかと言うと↓この方が分かりやすいですね。
Sub MyDataSet()
Dim MyR As Range, C As Range
Application.ScreenUpdating = False
Range("G2:G65536").ClearContents
Set MyR = Range("A2", Range("A65536").End(xlUp).Offset(-1)) _
.Offset(, 1).SpecialCells(2, 1)
For Each C In MyR
C.Resize(, 5).Copy
C.Offset(-1).PasteSpecial xlPasteValues, _
xlPasteSpecialOperationAdd
Application.CutCopyMode = False
Next
MyR.EntireRow.Delete xlShiftUp: Set MyR = Nothing
Range("A2", Range("A65536").End(xlUp).Offset(-1)) _
.Offset(, 6).Formula = "=SUM($B2:$F2)"
ActiveSheet.Calculate: Range("A1").Select
Application.ScreenUpdating = True
End Sub
|
|