Private Sub CalculateCharges()
Worksheets("Sheet1").Activate
Dim i As Long
Dim temp As String
RowCount = ActiveSheet.UsedRange.Rows.Count
ActiveSheet.Range("G1").Select
ActiveCell.Offset(1, 0).Select
i = 0
While i < RowsCount
If ActiveCell.Value Like "*W-M*" Then
ActiveCell.Offset(0, 8).Value = ActiveCell.Offset(0, 5).Value + ActiveCell.Offset(0, 6).Value
ActiveCell.Offset(1, 0).Select
End If
i = i + 1
Wend
End Sub
The above is my piece of code. Below is my excel look alike. How I can add up 2 values if a cell contain specific text value in it