The below macro does copy and paste as it should, however cell H38 is a summation of other sheets and all I want is that final value in cell H38 to be copied. Is there a way to alter this portion of macro for summation copy and paste?
'seventh macro
'copy cells
Sub copycell()
Dim WS As Worksheet, wsum As Worksheet
Dim wb As Workbook
Dim vws As Variant 'Need to use a Variant for iterator
Dim i As Integer, j As String
i = 0
Set wb = Workbooks("sheet1.xlsm")
Set wsum = wb.Sheets("summary2")
'Iterate through the sheets
For Each vws In wb.Sheets
If vws.Name <> "summary2" Then
j = CStr(i + 2)
vws.Range("b8").Copy wsum.Range("a" & j)
vws.Range("b9").Copy wsum.Range("b" & j)
vws.Range("b5").Copy wsum.Range("c" & j)
vws.Range("H38").Copy wsum.Range("D" & j)
i = i + 1
End If
Next vws
End Sub
Bookmarks