davidmyers
Board Regular
- Joined
- Jan 29, 2017
- Messages
- 88
- Office Version
- 2016
- Platform
- Windows
Hi I'm looking for a vba solution for the following:
Sheet1 Col A: Group Name
Col B: list of comma separated terms (for this Group)
Sheet2 Col A: text string
Col B: Group Name
I need to loop thru all the Groups in Sheet 1 and check if any of the terms in Sheet1 ColB appear in the text in Sheet2 Col A, if a match is found then copy the Group Name (Sheet1 ColA) to Sheet2 ColB and continue with the next cell in Sheet2 Col A.
What I have so far is:
Need help to write the VBA
Thanks
David
Sheet1 Col A: Group Name
Col B: list of comma separated terms (for this Group)
Sheet2 Col A: text string
Col B: Group Name
I need to loop thru all the Groups in Sheet 1 and check if any of the terms in Sheet1 ColB appear in the text in Sheet2 Col A, if a match is found then copy the Group Name (Sheet1 ColA) to Sheet2 ColB and continue with the next cell in Sheet2 Col A.
What I have so far is:
Code:
For each cell in Sheet2ColA
For each Group in Sheet1ColA
If (word in Sheet2ColA is found in Sheet1ColB) Then
Copy Sheet1ColA (Group Name) to Sheet2ColB
Exit For
End If
Next Group
Next cell in Sheet2ColA
Need help to write the VBA
Thanks
David
Last edited: