Niraj Baraili
Member
Any feedback will be much appreciated why i am getting Overflow Error in below code:
Code:
Dim SrchRng2 As Range, SrchRng1 As Range, cel As Range, cel1 As Range
Dim i As Long
Dim j As Long
lastrow1 = wkb2.Sheets("Summary").Cells(Rows.Count, "OE").End(xlUp).Row
Set SrchRng2 = wkb2.Sheets("Summary").Range("D6:D" & lastrow1)
i = 10
For Each cel In SrchRng2
If InStr(1, cel.Value, "Total") > 0 Then
For i = 10 To 395
Cells(cel.Row, i).Value = (Cells(cel.Row, i).Offset(, -4).Value + Cells(cel.Row, i).Offset(, -3).Value) / _
Cells(cel.Row, i).Offset(, -2).Value
Cells(cel.Row, i).Offset(, 1).Value = (Cells(cel.Row, i + 1).Offset(, -5).Value + Cells(cel.Row, i + 1).Offset(, -4).Value) / _
Cells(cel.Row, i + 1).Offset(, -2).Value
i = i + 6
Next i
End If
Next cel