hello all, I have come across the macro below, this allows me to look at the cell(A10)
on all sheets in my workbook even new ones (except sheet1) and ad the contents of all sheets together
then put the total in A10 on sheet1, this works great BUT I want it to work over a lot of cells,
example A1 TO J22 and place the result of each cell in the corresponding cells in sheet1.
can you help a newbie please
Sub updatethesum()
Dim ws As Worksheet
Dim i As Double
i = 0
Dim bletter As Boolean
For Each ws In ThisWorkbook.Worksheets
If ws.Name <> "Sheet1" Then bletter = IsNumeric(ws.Range("A10").Value)
If bletter = True Then
i = i + ws.Range("A10")
End If
End If
Next
Sheets("Sheet1").Range("A10") = i
End Sub
on all sheets in my workbook even new ones (except sheet1) and ad the contents of all sheets together
then put the total in A10 on sheet1, this works great BUT I want it to work over a lot of cells,
example A1 TO J22 and place the result of each cell in the corresponding cells in sheet1.
can you help a newbie please
Sub updatethesum()
Dim ws As Worksheet
Dim i As Double
i = 0
Dim bletter As Boolean
For Each ws In ThisWorkbook.Worksheets
If ws.Name <> "Sheet1" Then bletter = IsNumeric(ws.Range("A10").Value)
If bletter = True Then
i = i + ws.Range("A10")
End If
End If
Next
Sheets("Sheet1").Range("A10") = i
End Sub