FIND Beginning of field and add C to end of the field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I have a list of parts in Column A. I want to do a macro to find lets say
beginning 4 characters of the part and when it find to add letter C at end of
the part
Example.
TESTAB
XZZZTT
TESTPART

So lets say I'm searching for TEST, so my end result I'm looking is the
following
TESTC
TESTPARTC
Would appreciate any help
Thank you,
Juan
 
Try following macro

Sub SearchTest()
For i = 1 To 5 ' 5 = Last Rownumber to search
If Left(Cells(i, 1).Value, 4) = "Test" Then
Cells(i, 1).Value = Cells(i, 1).Value & "C"
End If
Next i
End Sub


Replace 5 with the last row aou want to look in.

Regards
reklamo
 
Back
Top