Code สำหรับการ copy จากหลายชีทไปยังชีทสรุป
Posted: Sun Jan 01, 2012 8:24 pm
Code: Select all
Option Explicit
Sub Summation()
Dim rSource As Range, rTarget As Range
Dim wh As Worksheet
For Each wh In Worksheets
If wh.Name <> "Sum" Then
Set rSource = wh.Range("B3", _
wh.Range("E" & Rows.Count).End(xlUp))
Set rTarget = Sheets("Sum") _
.Range("B" & Rows.Count).End(xlUp).Offset(1, 0)
rSource.Copy: rTarget.PasteSpecial (xlPasteValues)
End If
Next wh
Application.CutCopyMode = False
End Sub