Hi All
I have the below code which copies a row with certain criteria to another sheet and then deletes that row. How can I add to the code to do the following:
Before it copies and pastes to new sheet, It must insert "COD" into column F of each row that meets the criteria
Sub Move()
Dim TRow As String
Dim myrange As Range
Sheets("Temp").Select
TRow = "20160908286"
Set myrange = Sheets("Temp").Range("B2", Range("B" & Rows.Count).End(xlUp))
For Each cell In myrange
If cell.Value = TRow Then
lr = Sheets("Hist").Range("B" & Rows.Count).End(xlUp).Row
cell.EntireRow.Copy Destination:=Sheets("Hist").Range("A" & lr + 1)
cell.EntireRow.Delete xlShiftUp
End If
Next cell
End Sub
Bookmarks