Hello, I have a small problem. I have created code for myself but I cannot make a loop for all sheets ( every week it vary from 50 to 150 every week) I need to apply this code for all of the worksheets. What it does in every sheet I cave cell 2022 just one and in another column (13 in right) I have amounts so I select them and sum them in AG5. I would like to apply to all of the worksheets.
VBA Code:
Sub macro1()
Dim I As Range
Dim cell As Range
Set I = Range("O1:O50")
For Each cell In I.Cells
If cell.Value <> "2022.00" Then
cell.Offset(, 13).Resize(4).Select
Else
Range("AG5") = Application.Sum(Range(Selection.Address))
End If
Next
End Sub