assign values of 1, 2, 3, etc for multiple words within a cell
Hi, I have a description field with certain keywords I am extracting and based on the keywords (one or multiple) I want to assign a certain date.
1) Tab 1: has the description field and I am using a User defined function called keyword to look for one or more words from a list (wordlist on tab 1).
2) I have dates in 3-4 columns and based on whether it has one or more words, I want to assign (vlookup) the dates by using the the assigned numerical values for these extracted keywords. For ex: if a cell has only cooler, then I want to assign 1 and vlookup for ex: date in column z, and if it has cooler and engine, then max of 2 dates etc.
3) I am not sure how to loop through each cell and assign these numbers.
I have attached a sample file with the example sheet. I could not find any example on what to do and I was going through material on your site and I liked it very much.
I would appreciate it if you could lead me on the right track.
P.S. I could not send the actual file because of size limitation. Here is the function I am calling to list the keywords:
Function Keywords(Words As Range, strText As Range)
Dim c As Range
For Each c In Words
If InStr(1, strText, c, 1) > 0 Then Keywords = Keywords & ", " & c
Next c
If Keywords = 0 Then
Keywords = "-"
Else: Keywords = Right(Keywords, Len(Keywords) - 2)
End If
End Function
Thank you very much, regards, Rohini
Attachment | Size |
---|---|
keyword.PNG | 26.64 KB |
Recent comments
5 years 42 weeks ago
6 years 28 weeks ago
6 years 40 weeks ago
6 years 42 weeks ago
6 years 43 weeks ago
6 years 49 weeks ago
7 years 5 weeks ago
7 years 5 weeks ago
7 years 5 weeks ago
7 years 5 weeks ago