Thank you, Jayaraju.M! Your code works great! Thank you again, I appreciate you help. The Best, MikeB
On Sunday, July 26, 2015 at 3:09:44 AM UTC-5, Jayaraju Metta wrote: > > Hi Mike, > Below is the code to find string and paste it into desired cell. > Please find the attached excel file. > > 'Code was written by Jayaraju Metta > Sub matchsting() > i = 1 > While (ThisWorkbook.Sheets("Sheet1").Cells(i, 1).Value <> "") > > ColoumnAstring = Left(Trim(Sheets("Sheet1").Cells(i, 1).Value), 5) > ColomnCstring = Left(Trim(Sheets("Sheet4").Cells(i, 3).Value), 5) > If ColoumnAstring = ColomnCstring Then > Sheets("Sheet1").Cells(i, 2).Clear > Sheets("Sheet1").Cells(i, 2).Value = Sheets("Sheet4").Cells(i, 3).Value > ActiveSheet.Columns.AutoFit > Else > Sheets("Sheet1").Cells(i, 2).Clear > Sheets("Sheet1").Cells(i, 2).Interior.Color = "255,0,0" > End If > i = i + 1 > Wend > MsgBox ("Done Successfully") > ThisWorkbook.Save > ThisWorkbook.Worksheets("Sheet1").Activate > > End Sub > > > > > On Sat, Jul 25, 2015 at 8:27 AM, Mike B <mike...@gmail.com <javascript:>> > wrote: > > I would appreciate any help with the following. I have a column "A" of > data > > containing shortened names in sheet 1 and another column "C" containing > the > > same names but in a much longer version on sheet 4; I was thinking that > > perhaps I could somehow use the first five characters of the short name > in > > column "A" of sheet 1 to find the first five characters in column "C" > sheet > > 4 of the longer names and copy the longer names and paste them in column > "B" > > of sheet 1. Does anyone know if this can be done? I am new to VBA and > > struggling with how to go about it if it is possible and to what code to > > use. Thank you for any help. > > > > MikeB > > > > > > > > > > > > > > > > > > > > -- > > Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s > > =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ > > https://www.facebook.com/discussexcel > > > > FORUM RULES > > > > 1) Use concise, accurate thread titles. Poor thread titles, like Please > > Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice > will > > not get quick attention or may not be answered. > > 2) Don't post a question in the thread of another member. > > 3) Don't post questions regarding breaking or bypassing any security > > measure. > > 4) Acknowledge the responses you receive, good or bad. > > 5) Jobs posting is not allowed. > > 6) Sharing copyrighted material and their links is not allowed. > > > > NOTE : Don't ever post confidential data in a workbook. Forum owners and > > members are not responsible for any loss. > > --- > > You received this message because you are subscribed to the Google Groups > > "MS EXCEL AND VBA MACROS" group. > > To unsubscribe from this group and stop receiving emails from it, send an > > email to excel-macros...@googlegroups.com <javascript:>. > > To post to this group, send email to excel-...@googlegroups.com > <javascript:>. > > Visit this group at http://groups.google.com/group/excel-macros. > > For more options, visit https://groups.google.com/d/optout. > > -- > Regards, > Jayaraju.M > +91-9492162134 > -- Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ https://www.facebook.com/discussexcel FORUM RULES 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Jobs posting is not allowed. 6) Sharing copyrighted material and their links is not allowed. NOTE : Don't ever post confidential data in a workbook. Forum owners and members are not responsible for any loss. --- You received this message because you are subscribed to the Google Groups "MS EXCEL AND VBA MACROS" group. To unsubscribe from this group and stop receiving emails from it, send an email to excel-macros+unsubscr...@googlegroups.com. To post to this group, send email to excel-macros@googlegroups.com. Visit this group at http://groups.google.com/group/excel-macros. For more options, visit https://groups.google.com/d/optout.