I have come across another code, which does the similar function in MS Word, like antonyms, but it does for "Parts of Speech".
Now, what i would be requesting to have the code in excel VBA, that there is a WordList in Col A, and all the parts of speech are marked on the top row in the columns to the right, e.g. Col-B-Adjective, Col-C-Adverb, Col-D-Conjunction and so on.
As soon as the code is run, then all the cells from the Col-b to right gets filled up with appropriate word with respect to the header row, i.e. Parts of Speech of the Col A.
The below code does this in MS Word, probably this would be assisting in developing in Excel.
Anticipatory thanks!
Now, what i would be requesting to have the code in excel VBA, that there is a WordList in Col A, and all the parts of speech are marked on the top row in the columns to the right, e.g. Col-B-Adjective, Col-C-Adverb, Col-D-Conjunction and so on.
As soon as the code is run, then all the cells from the Col-b to right gets filled up with appropriate word with respect to the header row, i.e. Parts of Speech of the Col A.
The below code does this in MS Word, probably this would be assisting in developing in Excel.
Anticipatory thanks!
Code:
Sub parts_of_speech()
Set mySynInfo = Selection.Range.SynonymInfo
If mySynInfo.MeaningCount <> 0 Then
myList = mySynInfo.MeaningList
myPos = mySynInfo.PartOfSpeechList
For i = 1 To UBound(myPos)
'wdAdjective, wdAdverb, wdConjunction, wdIdiom, wdInterjection, wdNoun, wdOther, wdPreposition, wdPronoun, and wdVerb.
Select Case myPos(i)
Case wdAdjective
pos = "adjective"
Case wdNoun
pos = "noun"
Case wdAdverb
pos = "adverb"
Case wdVerb
pos = "verb"
Case wdConjunction
pos = "Conjunction"
Case wdIdiom
pos = "Idiom"
Case wdInterjection
pos = "Interjection"
Case wdPreposition
pos = "Preposition"
Case wdPronoun
pos = "Pronoun"
Case Else
pos = "other"
End Select
MsgBox myList(i) & " found as " & pos
Next i
Else
MsgBox "There were no meanings found."
End If
End Sub