Looking at the code in this solution posted by Andrew P some time ago https://www.mrexcel.com/forum/excel...ithout-specifying-what-words.html#post3573529
I was hoping to be able to modify it to achieve a basic classifier.
This is the relevant section from Andrews code.
How could I modify this to pick up the original text for the current word and count the words at - 1 and +1 ?
I was hoping to be able to modify it to achieve a basic classifier.
This is the relevant section from Andrews code.
Code:
wordCnt = 2 PuncChars = Array(".", ",", ";", ":", "'", "!", "#", _
"$", "%", "&", "(", ")", " - ", "_", "--", "+", _
"=", "~", "/", "\", "{", "}", "[", "]", """", "?", "*")
r = 1
' Loop until blank cell is encountered
Do While Cells(r, 1) <> ""
' covert to UPPERCASE
txt = UCase(Cells(r, 1))
' Remove punctuation
For i = 0 To UBound(PuncChars)
txt = Replace(txt, PuncChars(i), "")
Next i
' Remove excess spaces
txt = WorksheetFunction.Trim(txt)
' Extract the words
x = Split(txt)
For i = 0 To UBound(x)
WordListSheet.Cells(wordCnt, 1) = x(i)
wordCnt = wordCnt + 1
Next i
r = r + 1
Loop
How could I modify this to pick up the original text for the current word and count the words at - 1 and +1 ?