In this article, I will show how to use an Excel UDF to return a delimited string of antonyms. It uses Word VBA, so in order for the code to work, you must add a reference to the Microsoft Word Object library in the VBE, as shown below.
Then, the following code for the UDF can be placed in a general module in the VBE.
Function AllAntonyms(TheWord As String)
Alist = SynonymInfo(Word:=TheWord, LanguageID:=wdEnglishUS).AntonymList
For i = 1 To UBound(Alist)
If i = UBound(Alist) Then
DList = DList & Alist(i)
DList = DList & Alist(i) & “,”
AllAntonyms = DList
The result for using this UDF in a worksheet cell with the word “excited” as the lookup for antonyms in shown in the following figure.
There are a number of possibilties for extending/modifying this example to other useful UDFs. I hope that you find this useful in that regard.
You can download the workbook here.