tags:

views:

1110

answers:

5

I'm in need of a macro that will enter data into a webpage search field and than copy the results to excel.

+2  A: 

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
Joel Spolsky
That probably won't work for entering data into a search field (depending on if the field is POST or GET).
Joel Coehoorn
A: 

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

gary
A: 

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

adi92
A: 

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]

gary
+2  A: 

This is how I would approach it

  1. 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.
  2. Start recording a macro
  3. Select Data, Import External Data, WebQuery, and paste in the URL from step 1, so that you get the results pasted into a worksheet
  4. 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.

dbb