Excel 2003 VBA Help copying innertext

Guts_0

New Member
Joined
Apr 6, 2014
Messages
1
Hello everyone, I'm still new to VBA and trying to figure out how to copy the innertext from the description of a certain website. I'm using Lenox.com (Official Site) - Unique China & Giftware by Lenox and After I get VBA to go out to IE navigate to www.lenox.com and search a sku number. I get no errors in my code below but I'm doing something wrong. I can't figure out how to get the innertext to copy into a cell. here is my code below. It always leaves it blank on me. Hopefully someone can help me out. I'd really appreciate it.

Code:
Sub Lenoxtest()

Dim oForm As Object
Dim SKU As String
Dim URL As String
Dim objIE As Object

Dim eRow As Long
Dim ele As Object



Set sht = Sheets("Sheet1")
RowCount = 1
sht.Range("A" & RowCount) = "content"
sht.Range("B" & RowCount) = "description"






Set objIE = CreateObject("InternetExplorer.Application")

SKU = InputBox(" Enter Sku #. eg, 845123")

With objIE
.Visible = True
.navigate "http://www.Lenox.com"

While objIE.Busy And objIE.ReadyState <> 4: DoEvents: Wend
Set objIE = .document.body
Set oForm = objIE.getElementsbyTagname("Form")
Set oForm = oForm(0)

Set oInput = oForm.document.getElementByID("keywords")
            
            Set oBtn = oForm.document.getElementsbyTagname("input")
            Set oBtn = oBtn(1)
         
            oInput.Value = SKU
            oBtn.Click
            oForm.submit
            


For Each ele In .document.all

Select Case ele.classname
Case "title"
RowCount = RowCount + 1
Case "title"
sht.Range("A" & RowCount) = ele.innertext



End Select
Next ele

End With





Set objIE = Nothing

End Sub

here is an example of what it does when you enter a Sku #

http://www.lenox.com/dining/dinnerwa...x?R=25019&kf=1

takes you to a search result like this and then I'm trying to copy the description into excel.
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

Forum statistics

Threads
1,215,430
Messages
6,124,846
Members
449,194
Latest member
HellScout

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