Sub RunMe() Dim mFind As Range For Each cell In Range("A2:A" & Range("A" & Rows.Count).End(xlUp).Row) Set mFind = Sheets("Sheet1").Columns("A:A").Find(what:=cell.Value, lookat:=xlPart) If mFind Is Nothing Then GoTo NextCell mFind.Offset(0, 1).Value = cell.Offset(0, 1).Value NextCell: Next cell End Sub
Sub RunMe() Dim mFind As Range Sheets("Sheet2").Select For Each cell In Range("A2:A" & Range("A" & Rows.Count).End(xlUp).Row) Set mFind = Sheets("Sheet1").Columns("A:A").Find(what:=cell.Value, lookat:=xlPart) If mFind Is Nothing Then GoTo NextCell firstAddress = mFind.Address Do mFind.Offset(0, 1).Value = cell.Offset(0, 1).Value Set mFind = Sheets("Sheet1").Columns("A:A").FindNext(mFind) Loop While mFind.Address <> firstAddress NextCell: Next cell End Sub
Sub RunMe() Dim mFind As Range Sheets("Sheet2").Select For Each cell In Range("C2:C" & Range("C" & Rows.Count).End(xlUp).Row) Set mFind = Sheets("Sheet1").Columns("C:C").Find(what:=cell.Value, lookat:=xlPart) If mFind Is Nothing Then GoTo NextCell firstAddress = mFind.Address Do If mFind.Offset(0, -1).Value = cell.Offset(0, -1).Value And _ mFind.Offset(0, -2).Value = cell.Offset(0, -2).Value Then mFind.Offset(0, 1).Value = cell.Offset(0, 1).Value End If Set mFind = Sheets("Sheet1").Columns("C:C").FindNext(mFind) Loop While mFind.Address <> firstAddress NextCell: Next cell End Sub
DON'T MISS
I have done all the steps that u said. But when i double-click the macro i wish to run , nothing happens. Did i missed any necessary steps?
Hard to say if you missed anything. I did asume you would run the code from sheet2.
If that is not it, then consider uploading your file (careful with sensitive data) to a free filesharing site like www.speedyshare.com or ge.tt and then post back the download link.
Best regards,
Trowa
But now i gt another problem , like i gt multiple item with same name in different columns , but only the 1st item name that appear will get the letter code , the 2nd one with the same name won't get the letter code to be display. If i wan to get the letter code for all the item with same name , i should make what kinds of changes to my code?
Thanks again for helping.