tonywatsonhelp
Well-known Member
- Joined
- Feb 24, 2014
- Messages
- 3,194
- Office Version
- 365
- 2019
- 2016
- Platform
- Windows
Hi everyone,
I have a list of websites in column A
I need to check each website to see if it is a real estate site or not.
I have a macro that works great and allows me to do this manually, however it has occurred to me that a lot of the site I go to have the word real estate on the page that opens up!
It would be a massive time saver if I could set my macro up to look at this site and see if it contained the words real estate for me?
Currently the code below open up the websites one at a time, asks me if its a good site, I say yes or no and it records my answer in column B & C,
can someone adjust to the code so instead of asking me if its a good site, it looks at the website itself and if it finds the word real estate it answers yes, if not it answer no?
this is the code:
I have a list of websites in column A
I need to check each website to see if it is a real estate site or not.
I have a macro that works great and allows me to do this manually, however it has occurred to me that a lot of the site I go to have the word real estate on the page that opens up!
It would be a massive time saver if I could set my macro up to look at this site and see if it contained the words real estate for me?
Currently the code below open up the websites one at a time, asks me if its a good site, I say yes or no and it records my answer in column B & C,
can someone adjust to the code so instead of asking me if its a good site, it looks at the website itself and if it finds the word real estate it answers yes, if not it answer no?
this is the code:
Code:
Sub Start()
Dim ans
Dim one
one = 2
one = InputBox("What row do you want to start on", "Hello", "2")
'If you click on the Cancel button it will stop the script
Lastrow = Range("A1").End(xlDown).Row
For I = one To Lastrow
On Error Resume Next
Cells(I, 1).Select
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
Msg = "Is This A Good Site ? "
ans = MsgBox(Msg, vbQuestion + vbYesNoCancel)
If ans = vbYes Then
Call Macro1
Cells(I, 2) = "Good site"
ActiveWorkbook.save
End If
If ans = vbNo Then
Call Macro1
Cells(I, 3) = "bad"
ActiveWorkbook.save
End If
If ans = vbCancel Then Exit Sub
Next
one = ""
End Sub
hope someone can help
Thanks
Tony