Macro to open a website from a list in excel ask me if its what i'm looking for then add yes or no next to the web address in excel?

tonywatsonhelp

Well-known Member
Joined
Feb 24, 2014
Messages
3,194
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
Hi everyone,
OK I've got a big challenge for you all now,
I have a list of websites in column A of a spreadsheet, the number of website will vary as I have lot of sheets to go through, however what I want to do is open each site to see if its the type of website I'm looking for and put a yes or no next to each site.
so I'm looking for a macro that can start at A2 open up the web address in A2, then ask me "is this what you are looking for? I answer yes or no and the answer gets put into the excel document in column B next to the website (B2), we then move on to cell A3 and do the same thing and carry on until I've done all web sites in my list.
Does anyone know if this would be possible? if so,
how I could do it?
I'm on office 2013 and in have internet explorer and chrome loaded if that helps.

I know this might be to big a question for someone to answer on here but I was hopping maybe somebody would know how to do it?
here is a snippet of the websites if you need to test anything:
I could really do with help on this?

Thanks

Tony
 
Tony
I wrote a new way to do this. Disregard my previous script. Let me know how this works

Code:
Sub Start()
Dim ans
'If you click on the Cancel button it will stop the script
Lastrow = Range("A1").End(xlDown).Row
For i = 1 To Lastrow
    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
        Cells(i, 2) = "Good site"
        End If
        If ans = vbNo Then
        End If
        If ans = vbCancel Then Exit Sub
        Next
        End Sub
 
Upvote 0

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Tony. People like me continue to tweak things like this. I did think you may want to choose what row to start the script on. If you have a lot of these to go through you may want to stop for a while and restart. So I modified the script to let you choose the row you start on. If the last script I sent you works and you want my newer modified script and I will send it too you.
 
Upvote 0
Hi Mate,
I really apreasiate your help,
I've not been able to get your code to run, but I don't think this is the codes fault, I had a problem with the hyperlinks as none of them worked so I had to change the way it was doing it, I've had to remove all hyperlinks from column A so it just has the website address but no link then in column b I've had to do the formula =hyperlink(A1) and copy it down so the hyperlinks are in column B, but there are just formula hyperlinks, as in they work when I double click them but not when you open up the hyperlink details they are not there.
I couldn't find a way to redo all the hyperlinks so this was my only option.
I'm sorry to give you more headaches, but unless you know a way to reset all the hyperlinks I don't think I'm going to be able to get this to work.
I'm currently using your first idea, and its working so a big thank you for that.
if you think of anything let me know please mate.
Thanks
Tony
 
Upvote 0
Ok, it a bit confusing for me, but basicly, when you create a hyperlink if you right click and click edit hyperlink you will see at the to it has display as this is just the text, at the bottom it has address and this is the hyperlink address i.e. the web address its going to open, but when I do it the web address is empty.
the only way I've found to solve this would be to click on every cell twice then press enter and it fixes the problem but I can't FIND A MACRO TO DO THAT.
 
Upvote 0
I have tested this numerous times on my computer and it works perfectly. The hyperlink does have to look like this " WWW.cnn.com" not like this "Cnn.com" now even if I add what's called a friendly name it still works as long as the address starts with http or www
 
Upvote 0
Hi Mate,
I know, your code works great, its my list that is messed up,
I'm going to post on here a new posting to see if anyone can help me with what I need to fix my hyperlinks as it would be great to use your new version.
I'm going to ask you on more thing?
I've noticed that my pc sometime crashes or fresses when I'm doing this, its just my pc, I need a new one, however what I'm doing is saving every two or three goes so if it happens I can start again without any problem.
I'd like to use your latest version with the ability to choose the cell I start from, however, could you do it so it saves everytime it runs?
it only needs to be save, as I will have set up the file etc. before we begin. just an idea if its something that can be done?
lease send latest copy over so I can use it tomorrow.
thanks
Tony
 
Upvote 0
Tony. Send me a sample of the hyperlinks that are bad. If you could post a few here I may be able to solve that problem. So by save do you mean automatic save the file at the end of each session.
 
Upvote 0
Good News,
One of the guys just sent me the fix for my hyperlinks so they are all working perfectly now! :)
I'm so please, now if you don't mind posting your latest code I'll get cracking with this tomorrow!
Again A massive thank you for getting this sorted out for me, I can't thank you enough to be honest,
I do believe I now got this problem solved! :)
Tony
 
Upvote 0
Tony. That's great. My last question for you now is you mentioned you wanted the script to "Save" I will need to know when you want it to save. And you should know putting a save command in a script may be dangerous in that if something goes wrong and the script saves you may have wished that had not happened. After you answer that question I will send you the new file with that change.
 
Upvote 0

Forum statistics

Threads
1,215,066
Messages
6,122,948
Members
449,095
Latest member
nmaske

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top