Macro to Search for a word and put a code on the cell next to it

A.E - Apr 26, 2015 at 06:23 AM
 A.E - Apr 28, 2015 at 04:02 AM
I'd like to scan a column for a certain word ("TOTAL LINE") and put a code (e.g "a") on the cell next to it each time it finds it.In case that raw is dynamic

1 response

MaxStart Posts 339 Registration date Tuesday March 3, 2015 Status Moderator Last seen July 3, 2015 69
Apr 26, 2015 at 08:12 AM
Sub go()
Dim i As Integer, Cell As Range, Cell2 As Range
i = 1
'This will Search Sheet1 Column1
'and set the value to cell next
Do Until ThisWorkbook.Sheets(1).Cells(i, 1).Value = ""
    Set Cell = ThisWorkbook.Sheets(1).Cells(i, 1)
    Set Cell2 = ThisWorkbook.Sheets(1).Cells(i, 2)
    If Cell.Value = "TOTAL LINE" Then
        Cell2.Value = "a"
    End If
i = i + 1

End Sub
thank you for your respond