total value of a column in all the sheets to be consolidated in another worksheet
Hi,
can some one assist with my requirement.
i have an workbook with 6 worksheets. I need to find the sum of value in column no 10 after the last used row.
with the below code i can get the total only for the active sheet. Am not sure how to loop through all the sheets to have the total value inall the sheets.
[VBA]
Sub sum()
Dim LastRow As Long
Dim iRow As Long
Dim iCol As Integer
LastRow = 0
Dim ws As Worksheet
For Each ws In Worksheets
'Find last row
For iCol = 1 To 76
iRow = Cells(65536, iCol).End(xlUp).Row
If iRow > LastRow Then LastRow = iRow
Next iCol
With Application.WorksheetFunction
For iCol = 30 To 30
Cells(LastRow + 1, iCol) = .sum(Range(Cells(1, iCol), Cells(LastRow, iCol)))
Next iCol
End With
Next ws
End Sub
[/VBA]
Once we found the total of values in column 30, i need to append only the total amount in the excel file which is in different folder. Total from all the sheets to a single sheet.
-Sindhuja