copy value cells into IE

Boris7265

Board Regular
Joined
Apr 6, 2011
Messages
68
Hello all,
I working with a large spredsheet ( 20000 rows or so) and some cells in row E (named court) is empty.I have to launch IE , go to usps web site and copy-paste values in cells F( address),G(city),and H(zip code) into IE USPS website text boxes and there are lot of copy-paste involving. I am curious if I would launch one time IE, then go to USPS website and copy-paste all three cells that are in the rows F,G and H corresponding empty cell in row E and copy them all together onto corresponding text boxes on IE .In onther world , if it is possible to be done following: launch IE one time and keep it open, got to specific website ,and copy paste value of cells into website as many time I wish done via vb thru the macro
Thank you in advacne for any help and hit,
The Best Regards,
BorisGomel
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Yes, this is possible. Search for "IE automation VBA" and HTMLdocument (defined in the Microsoft HTML Object Libary) for examples. Any code will be largely specific to the particular web site you are automating, but the examples should give you a starting point.

You could use MSXML2.XMLhttp (part of the MS XML v6.0 library) instead of IE, together with the HTML library. This will be much faster because it doesn't have to render the web site's HTML in the IE browser.

If you give the specific USPS URL and explain exactly which data you want to extract from the web page, having populated the relevant address input fields, I'm sure some people will be able to help with the code.
 
Upvote 0
Thank you very much sir!!!

Here is more detail :
URL is https://tools.usps.com/go/ZipLookupAction!input.action?mode
There ARE three text boxes on the USPS site :*Street Address,*City, and *Zipcode. The *State must be selected by the scroll menu and I do it. The cells in column F coorepsonding is for Street Adress, G is for City and H is for Zipcode. I have done autofilter to filter the spreadsheet with emty cell in column E and pu this in macro. So now I have rows with empty column E (courtname) and all data corresponding to them . I would like to copy cells F, G and H all together ( now I am doing copy them indivudually) and paste them into corresponding text boxes on USPS site, select the state and find the county and court. I am not sure-I think I need to place a command button on spreadsheet put vb code in there that selecting cells in column F , G and H would be pasted into text boxes on USPS site at once.The code so far I have come up is :

ie.Document.getElementById("tAddress").Value =selection.paste ie.Document.getElementById("tcity").Value =selection.paste
ie.Document.getElementById("zip").Value = selection.paste

"tAddress" is the name of the text boxesa that should be populated on USPS site. I have obtained them from view source.
Thank you in advance for help.
The bEST REGARDS,
BORISGOMEL
 
Upvote 0
The URL of the results page contains all the search parameters from the HTML form, which means you don't need to populate and submit the form fields. Just construct the complete URL from your address details and request the page directly.

And instead of IE and HTML manipulation, you could use a web query to retrieve the data. Create the web query on a separate sheet and import the entire page, then write code to loop through your addresses, and for each address modify the query's URL connection parameter, do a VBA Find to look for the required data (in case it isn't in the same cell for each address) and copy the data values to your main sheet.
 
Upvote 0

Forum statistics

Threads
1,207,111
Messages
6,076,620
Members
446,216
Latest member
BEEALTAIR

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