Option Compare Text
Option Explicit
Sub OpenHTMLpage_SearchIt()
Dim Cell As Range, Keyword$, N%, SearchAgain As VbMsgBoxResult
Application.Workbooks.Open ("http://www.geocities.com/johnske100/TheFINDfunction.html")
Columns(1).ColumnWidth = 85
MsgBox "When finished - click X on the web window to close it "
StartSearch:
N = 0
Keyword = InputBox("Enter the word or phrase you are looking for", "Keyword Is ?")
If Keyword = Empty Then GoTo StartSearch
For Each Cell In Range("A1:A500")
If Cell Like "*" & Keyword & "*" Then
MsgBox "An " & Keyword & " was found at " & Cell.Address & " (" & Cell & ")"
N = N + 1
End If
Next Cell
If N = 0 Then MsgBox "Sorry, no " & Keyword & "'s found", , "not Found"
SearchAgain = MsgBox("Another search?", vbYesNo, "More?")
If SearchAgain = vbYes Then GoTo StartSearch
End Sub
|