Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 32984723987 BLA BLA &*& KEYWORD 232328 BLA
- =VLOOKUP("*"&table2!A1&"*", table1!A:A, 1, FALSE)
- Sub findKeywords()
- Dim wb As Workbook
- Dim rWs, kWs As Worksheet
- Dim dataColumn, targetColumn, keysColumn As Integer
- Set wb = ThisWorkbook
- Set rWs = wb.Sheets("rawSheet") 'this is the sheet your raw data is
- Set kWs = wb.Sheets("keySheet") 'this is your sheet with the keys
- dataColumn = 1 'this is the number of the column you will search
- targetColumn = 2 'this is the number of the column you will insert the matched row
- keysColumn = 1 'this is your column with the keywords you will look for
- For Each r In rWs.range(rWs.Cells(1, dataColumn).Address, rWs.Cells(rWs.Rows.Count, dataColumn).End(xlUp).Address)
- For i = 1 To kWs.Cells(kWs.Rows.Count, keysColumn).End(xlUp).Row
- If r.Value Like "*" & kWs.Cells(i, keysColumn).Value & "*" Then
- r.Offset(0, 1).Value = kWs.Cells(i, keysColumn).Row
- End If
- Next i
- Next r
- End Sub
Add Comment
Please, Sign In to add comment