Query Source : Excel Macros Google Group
Solution Type : Internet Explorer and VBA
Query by : Dave K
Solution by : Ashish Jain (Microsoft Certified Application Specialist;Lead Trainer, Success Electrons)
Query / Problem:
Is there code that could perform the following:
1. Copy the data that lies in the active cell.
2. Go to an open window (in explorer or mozilla) of www.ebay.com (or open an entirely new window of ebay.com, if that makes it easier).
3. Paste the data into the search box at www.ebay.com (which by default is the active field when a new window of ebay is opened)
4. Hit "enter" at ebay to display the search results.
I am new to VBA and computer programming, but any suggestions or guidance you can provide would be very much appreciated.
1. Press Alt+F11. (To write the macro in Code Editor.)
2. Go to Tools --> References --> Select "Microsoft Internet Controls".
3. Copy-Paste the following code.
'Requires Reference to "Microsoft Internet Controls"
'Declare Reference to InternetExplorer Object
Dim MyBrowser As SHDocVw.InternetExplorer
'Set Reference to InternetExplorer Object
Set MyBrowser = New SHDocVw.InternetExplorer
'Make the Browser visible
.Visible = True
' Open Ebay.com with Active Cell Value
.Navigate "http://shop.ebay.com/?_from=R40&_trksid=m38.l1313&_nkw=" _
& ActiveCell.Value & "&_sacat=See-All-Categories"
4. Now, run this macro as desired and whenever required.