Hi All,
Ok, So I have a "Description" column that contains a long text description in each cell, and I have thousands of cells like this.
So what I'm trying to do is to classify each cell by main keywords.
B.W it should be possible to have a few keywords for each description.
-----
I have 20 keywords, and my main issues of what I did so far are:
This Is what I wrote so far:
Kind Regards,
Ok, So I have a "Description" column that contains a long text description in each cell, and I have thousands of cells like this.
So what I'm trying to do is to classify each cell by main keywords.
B.W it should be possible to have a few keywords for each description.
-----
I have 20 keywords, and my main issues of what I did so far are:
- Writing over each time
- Making sure "ITM" is a word by itself and not part of a word.
- Reliability of classification - I thought by counting the amount of time each words repeats itself within a cell.
This Is what I wrote so far:
Sub textsearch() Dim c As Range, scount As Integer, stText As String For Each c In Range("AL:AL") For Each Word In Array("feeder", " ITM ", " IMP ", "word1", " word2", " petrol", "Paper", "Oil") If InStr(1, c.Value, Word, vbTextCompare) > 0 Then c.Offset(, -2).Value = Word stText = c.Value scount = (Len(stText) - Len(Replace(stText, Word, ""))) / Len(Word) c.Offset(, -1).Value = scount End If Next Word Next c End Sub |
Kind Regards,