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
 
Your welcome Tony I like doing this. I like Userforms tell me what you would like
 
Upvote 0

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Ok
well, your going to enjoy this!
so I'm creating an employees database, the amount of data etc don't really matter because its all done by textbox names, and I will be able expand the code myself if you can come up with it,
So to keep it simple lets say the form only has 3 bits of data Name (aka dropdownbox1), address (aKA TEXTBOX1) and zipcode (AKA TEXTBOX2).
Now I can set it up so when I get a new customer I input the details into the 3 boxes and click submit and the data is added too a database (Sheet1), this is fine.
the problem is I need to be able to retrieve the data from the database (Sheet1) back into the form so this information can be edited.

so the problem ive got is threefold,

part 1 is how do I create a dropdown box in the userform1 to pull the relevant customers name from the data in Sheet1 Column A (which is the clients names) into the dropdown box?
part 2 is even more trick, how can I them get the data in Column B (address) back into textbox1 and column C (zipcode) back into Textbox2? for that client?
and the very hardest part which I'm completely lost on is how can I then click a submit button and have the update information returned to Sheet1 into the row the data was in?

if that makes sense? great? if not I try explain it again, but basically I want a way to be able to go to a userform, select any name from a drop down box, pull that employees data through into the userform edit the details and send it back to the row the clients details were in,

if his my 5 employee and his in row 6 there will be loads of employees around him in all the other rows, I need to get the data back into row 6?

now I'm sure that has made you think,

I'm not quite finished on building the spreadsheet so we have another day or two, but if you have any ideas please let me know because I'm stuck.
Thanks

Tony
 
Upvote 0
I understand your request. Not sure I'm able to figure that one out. I will play with it but it could take me several days or more and I'm not sure even then I could figure that one out. So you may want to post it in another thread and see if you get some help. let me know if you get an answer. I would still like to know how you were able to get the script I sent you to "Save" inside a Module.
 
Upvote 0
Hi Mate,
I think I have the only way it can possably work, its a bit long winded and not the done thing but I tested it and it done what I wanted, basically instead of returning the data to the line it was in, it involves returning the edited data to the sheet in a new row and deleting the old data, its still early days, recon this is going to take at leatest a day to work out properly but i'll get there somehow!

anyway,
just so you know what I did with your amazing bit of code, here is the final version that I am using just for you to see.

thanks

Tony

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
 
Upvote 0
Tony
That's interesting. What does "Macro1" look like. I'm surprised "Active Workbook Save" actually works. I knew about "Active Workbook Save" but I did not think it would work inside a module. Your previous request that was a hard part I could not figure out having the Userform put the data back in the same cell it came from. Glad things are going well for you.
 
Upvote 0
Hi Mate,
Macro1 is just the code to close the Internet Explorer, otherwise I'd end up with 100'S of tabs open,

its just:
Code:
Sub Macro1()
'
' Macro1 Macro
'
    Dim Shell As Object
    Dim IE As Object
 
    Set Shell = CreateObject("Shell.Application")
 
    For Each IE In Shell.Windows
        If TypeName(IE.Document) = "HTMLDocument" Then
            IE.Quit
        End If
    Next
    
'
End Sub

I think I've worked out the user form problem, I wont know for a day or two as I'm not ready to create the actual form yet, just been testing with smaller versions to see if my idea can work, but I think ive got it! :)
anyway thanks for helping me, very much appreciated.
Tony
 
Upvote 0
Now I have another question. We are both learning more here. I was not able to see the prompt asking if this was a good site until I closed the IE Window. How were you able to see the prompt prior to closing the IE Window?
 
Upvote 0
Hi mate,
Is that because the website open up in the full screen?
I just set it up so one side of the screen has the website, (the right side)
and the Document is on the left side, the textbox opens in the middle of the screen so I can see all items at the same time, when I click yes/ no it closes the i.e. for me, then the next time it opens i.e. it open in the reduced screen again.
It might help the I work on a 65" monitor so I have loads of room for all the data?

another challenge for you you might like. (I've just posted this as another thread!)

I've noticed that a lot of the sites when I open them contain the words "real estate", instead of me manually answering yes / no how can I get the macro to check the website for the words "real estate" and if it has them answer yes / if not answer no?

Any ideas?

Tony
 
Upvote 0

Forum statistics

Threads
1,214,866
Messages
6,121,996
Members
449,060
Latest member
mtsheetz

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