tonywatsonhelp
Well-known Member
- Joined
- Feb 24, 2014
- Messages
- 3,197
- Office Version
- 365
- 2019
- 2016
- Platform
- Windows
Hi Guys,
ok so I have a macro that opens up a list of websites one by one for me to inspect.
a lot of the sites I'm looking for have the word "Real Estate" in the header, or the tab at the top of the page, (I'm not sure the technical word for it, but as you load the page the tab show data, this often has the word real estate in it,
so I was wondering if there was a way to get the vba code to look for that word in the header (or whatever its called) and if its there automatically answer yes and no to my macro instead of me having to do t manually?
This is the macro I currently use the part that says call macro1 this is just a macro to close the internet Explorer otherwise I end up with loads of tabs open.
anyway, if anyone can help me it would be a great help.
here's the code I currently use to open the websites one at a time, so instead of it asking me if its a good site, I'd like it to make up its own mind depending on if the header has real estate in it or not.
thanks
Tony
ok so I have a macro that opens up a list of websites one by one for me to inspect.
a lot of the sites I'm looking for have the word "Real Estate" in the header, or the tab at the top of the page, (I'm not sure the technical word for it, but as you load the page the tab show data, this often has the word real estate in it,
so I was wondering if there was a way to get the vba code to look for that word in the header (or whatever its called) and if its there automatically answer yes and no to my macro instead of me having to do t manually?
This is the macro I currently use the part that says call macro1 this is just a macro to close the internet Explorer otherwise I end up with loads of tabs open.
anyway, if anyone can help me it would be a great help.
here's the code I currently use to open the websites one at a time, so instead of it asking me if its a good site, I'd like it to make up its own mind depending on if the header has real estate in it or not.
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
thanks
Tony