![]() |
FIND Beginning of field and add C to end of the field
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 |
FIND Beginning of field and add C to end of the field
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 "Juan" wrote: 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 |
FIND Beginning of field and add C to end of the field
Hello Reklamo,
thanks alot for your help. This works :) Have a great weekend. Juan "reklamo" wrote: 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 "Juan" wrote: 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 |
All times are GMT +1. The time now is 07:40 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com