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
2,572
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:
http://www.alcscapital.com/
http://www.vanessapollock.com/
http://www.propertyexhibit.com/
http://www.bergenhomeinfo.com/
http://www.azteccontainer.com/
http://www.islandappraisal.com/

<COLGROUP><COL style="WIDTH: 656pt; mso-width-source: userset; mso-width-alt: 32000" width=875><TBODY>
</TBODY>
I could really do with help on this?

Thanks

Tony
 

Some videos you may like

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

Steph77

Board Regular
Joined
Sep 18, 2014
Messages
119
I can't write VBA code off the top of my head like some others here can, but I think you can break it down into these steps and then find the individual bits of code for each, then put them together into a single sub:

1. Resize the main excel window to the same size as the "Yes/No" popup button prompt (this may require a little experimentation and adjustment)
2. Open website 1
3. Make Excel the active application and produce the yes/no button
4. Add the value depending on the decision to column B
4a. (optional) close the IE tabbed just opened (or maybe only if the user clicked "no")
5. Repeat from step 2 until end of list
5a. (optional) close all the tabs in IE opened by the process (or just those the user clicked "no" to)
6. Resize the excel window to maximum again.

4a and 5a are optional depending on how you want the PC to be left after the macro has finished, only one or the other is needed.

All of those 6 steps are things you can find in a search on this forum or google. Sorry I can't be more helpful by supplying specific code but if you put something together and it's not working you can always come back and post it and I can help find errors (I'm better at reading code than writing it)
 

tonywatsonhelp

Well-known Member
Joined
Feb 24, 2014
Messages
2,572
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
Hi Steph77,
I appreciate your help,
I will attempt to follow your guidance and see what I can find but if anyone can give me more help I would be very grateful as I doubt my skills will be enough to do this myself? I always end up running around for hours chasing my tail.
all help will be very much appreciated.
Thanks
Tony
 

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
16,816
Office Version
  1. 2013
Platform
  1. Windows

ADVERTISEMENT

Thy This:
In your sheet put a web address in any cell
Then double click the cell after doing this:
Right Click on your sheet tab
Choose View code
Paste the below code:
Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim answer
answer = MsgBox("Is This a Good Site?", vbYesNo + vbQuestion, "Empty Sheet")
If answer = vbYes Then
ActiveCell.Offset(0, 1) = "Good site"
ActiveCell.Offset(0, 1).Select
answer = ""
End If
 

tonywatsonhelp

Well-known Member
Joined
Feb 24, 2014
Messages
2,572
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
Hi My Answer is this,
your code works great for putting the answers in,
thank you,
I wish there was a way I could get it to do the opening and closing of the websites as well?
 

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
16,816
Office Version
  1. 2013
Platform
  1. Windows

ADVERTISEMENT

tonywatson:

My script should have opened the web site. How would the script know when you want to close it?
 

tonywatsonhelp

Well-known Member
Joined
Feb 24, 2014
Messages
2,572
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
Hi My Answer is this,
your script opens the website yes, its great and might be as good as I can hope for, but what I was hoping to get was a script that would open the website ask me if its what I wanted, then when I answer yes or no close the website and go to the next one in the column and open that one.
the reason being is I've got 1,000s of these sites to open, most wont be what I want, so if I can save a little time have the website open and close automatically it will save me a lot of time in the long run.
your code will help me enormously, but if I could get it fine tuned to just do everything and all I need do is click yes or no it would be perfect.
if you or anyone knows a way to do this I would be so grateful.
 

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
16,816
Office Version
  1. 2013
Platform
  1. Windows
Tony. Ok I understand now. I will see what I can do. This first attempt was to see if this is part of what you want. I will work on this and get back with you in a day or two.
 

Watch MrExcel Video

Forum statistics

Threads
1,108,806
Messages
5,524,983
Members
409,613
Latest member
Dalex100

This Week's Hot Topics

Top