Experts Exchange Solution brought to you by
"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.
Set sh1 = Sheets("Sheet1")
Set sh2 = Sheets("Sheet2")
Set regex = CreateObject("VBScript.RegExp")
Set rngWrds = Range(sh2.Range("A1"), sh2.Range("A" & Rows.Count).End(xlUp))
aRng = WorksheetFunction.Index(WorksheetFunction.Transpose(rngWrds), 1, 0)
strRng = Join(aRng, "|")
.Global = False
.MultiLine = False
.IgnoreCase = True
.Pattern = "\b(" & strRng & ")+\b"
For Idx = sh1.Range("A" & Rows.Count).End(xlUp).Row To 1 Step -1
If regex.Test(sh1.Range("A" & Idx)) Then
sh1.Range("A" & Idx).EntireRow.Delete
Open in new window
Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.
Managed service contracts are great - when they're making you money. Yes, you’re getting paid monthly, but is it actually profitable? Learn to calculate your hourly overhead burden so you can master your IT services pricing strategy.
Function WordFreq() As Object
Dim dicWords As Object
Dim oRE As Object
Dim oMatches As Object
Dim oM As Object
Dim oXMLHTTP As Object
Dim strHTML As String
Set oXMLHTTP = CreateObject("MSXML2.XMLHTTP")
oXMLHTTP.Open "GET", "https://www.wordfrequency.info/free.asp?s=y", False
Do Until oXMLHTTP.ReadyState = 4
If oXMLHTTP.Status = 200 Then
strHTML = oXMLHTTP.responsetext
Set dicWords = CreateObject("scripting.dictionary")
Set oRE = CreateObject("vbscript.regexp")
oRE.Global = True
oRE.Pattern = "<tr>\s*<td>(\d+)</td>\s*<td>([^<]+)</td>"
Set oMatches = oRE.Execute(strHTML)
For Each oM In oMatches
If dicWords.exists(oM.submatches(1)) Then
dicWords(oM.submatches(1)) = oM.submatches(0)
Set WordFreq = dicWords
From novice to tech pro — start learning today.
Members can enroll in this course at no extra cost.