Welcome . Please help in creating a code that enables me to copy and sort the data so that the values are copied into an excel sheet whose name is in column A
I have a file of 10 excel sheets
I want to copy each row in its excel sheet with addition in the last row of plurals for columns automatically and when copying again the sum is updated
Example
I created this code, but I can't get the sum of the columns
I have a file of 10 excel sheets
I want to copy each row in its excel sheet with addition in the last row of plurals for columns automatically and when copying again the sum is updated
Example
I created this code, but I can't get the sum of the columns
VBA Code:
Sub copy()
ActiveSheet.unprotect
Set ws = ActiveWorkbook.Sheets("data")
Dim cl As Range, i As Integer
For i = 1 To Sheets.Count
For Each cl In ws.Range("a13:a" & ws.[a10000].End(xlUp).Row)
If cl.Value = Sheets(i).Name Then
Sheets(i).Range("a" & Sheets(i).[a10000].End(xlUp).Row + 1).EntireRow.Insert
Sheets("data").Select
cl.Offset(0, 2).Resize(1, 5).copy
Sheets(i).Range("a" & Sheets(i).[a10000].End(xlUp).Row + 1).PasteSpecial xlPasteValues
End If
Next
Next
End Sub