Hi all,
I need some help. I have 2 workbooks, one (results.xlsm) with SKUs in Column A, and I would like keywords I have for them put into Column B.
The 2nd workbook (keywords.xls) has some SKUs in Column A, and corresponding keywords in Column B.
I would like to use some VBA to match SKUs and where matched place Column B contents over. I have experience (thanks to here) with range.replace, and this is my example which would work (except it overwrites the SKU in Col.A, as opposed to putting the matched data beside it). Oh and also this code is using M:N for the SKU/keywords lookup - I've not had to make it look at another workbook yet)
Any advice on what I should best be using would be much appreciated!
I need some help. I have 2 workbooks, one (results.xlsm) with SKUs in Column A, and I would like keywords I have for them put into Column B.
The 2nd workbook (keywords.xls) has some SKUs in Column A, and corresponding keywords in Column B.
I would like to use some VBA to match SKUs and where matched place Column B contents over. I have experience (thanks to here) with range.replace, and this is my example which would work (except it overwrites the SKU in Col.A, as opposed to putting the matched data beside it). Oh and also this code is using M:N for the SKU/keywords lookup - I've not had to make it look at another workbook yet)
Code:
Sub keywords()
Dim R As Range, Tbl As Range, c As Range
Set R = Range("A2:A" & Cells(Rows.Count, "A").End(xlUp).Row)
Set Tbl = Range("M:N")
Application.ScreenUpdating = False
For Each c In Tbl.Columns(1).Cells
R.Replace c.Value, c.Offset(0, 1).Value, xlPart
Next c
Application.ScreenUpdating = True
End Sub
Any advice on what I should best be using would be much appreciated!