Skip to content

Instantly share code, notes, and snippets.

@Atreyagaurav
Created July 22, 2019 14:57
Show Gist options
  • Save Atreyagaurav/0fb1b576cc5188d1834f7ab830647bb8 to your computer and use it in GitHub Desktop.
Save Atreyagaurav/0fb1b576cc5188d1834f7ab830647bb8 to your computer and use it in GitHub Desktop.
VBA code to find meaning of the phrase/word in active cell
Public Sub SeekMeaning()
Dim appIE As Object
Set appIE = CreateObject("internetexplorer.application")
On Error GoTo en
Dim seStr As String
seStr = Replace(ActiveCell.Value, " ", "-")
With appIE
.Navigate "https://www.dictionary.com/browse/" + seStr
.Visible = False
End With
Do While appIE.Busy
DoEvents
Loop
Set allrowofdata = appIE.document.getelementsbyclassname("one-click-content css-0 e1w1pzze1")
Dim i As Integer
i = 1
For Each dat In allrowofdata
MsgBox dat.innerText, vbOKOnly, "Meaning " + CStr(i)
i = i + 1
Next
en:
appIE.Quit
Set appIE = Nothing
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment