I'm in need of a macro that will enter data into a webpage search field and than copy the results to excel.
It's just a simple "File Open". No need for a macro.
Excel can open URLs directly. If the URL contains any tables, those will be formatted appropriately.
Try this:
- Run Excel
- File | Open
- Type
http://finance.yahoo.com/q?s=MSFT
as the file name - Ignore the warning
ok Im sorry I will be more specific, I need it to be automated and search a number like 123456 and than copy the results to excel, than go back to the search page and search on the next # 123457, 123458, 123459 but each time copy the result to notepad or excel for later use
if using excel is not a constraint in your question.. i.e. you can use other software to get the job done.. you should check out Google Spreadsheet.. its a lot more webfriendly... has functions that can retrieve some page.. or alternatively google for something nd then put the results in your table.. http://spreadsheets.google.com/
after that you can save the file in .xls format and bring it to any other platform
what I really need is someone to write the program for me and I would glady pay for that service, if you have any recommendations on where i could find such a person that would be great, please email me at [email protected]
This is how I would approach it
- find out the URL structure, ie do the search manually and look at the URL of the answer. If it contains the search term, eg ?c=123456, you are in business.
- Start recording a macro
- Select Data, Import External Data, WebQuery, and paste in the URL from step 1, so that you get the results pasted into a worksheet
- Stop recording, and edit the VBA code so that you can (a) alter the search number programmatically (b) refresh the query (c) capture the value(s) you want and put them somewhere
This does require some VBA skills but is not too hard as long as the URL contains the search term. If it doesn't (eg if it is sent through as a web form), you can still use the approach above, because Excel can handle form-based web queries, but it is a little harder.