Hi everyone
I need to add a text 'P-' to the cell text in column F based on the value of column M. If column M's cell value is 'Test', then 'P-' have to add to the text in column F e.g. P-XYZ123
I have setup code as below, however it doesn't work:
Please could anyone help? Many thanks.
I need to add a text 'P-' to the cell text in column F based on the value of column M. If column M's cell value is 'Test', then 'P-' have to add to the text in column F e.g. P-XYZ123
I have setup code as below, however it doesn't work:
Code:
Dim Lst As Long, r As Long
Lst = Range("A" & Rows.Count).End(xlUp).Row
For r = 1 To Lst
With Sheets("Combined_Data").Range("M" & r)
If .Value = "Test" Then
.Range("F" & r).Value = "P-" & Range("F" & r).Value
Exit For
End If
End With
Next r
Please could anyone help? Many thanks.