PDA

View Full Version : open charts from list



irozak
09-18-2008, 06:09 AM
I am trying to get the macro to grab the first code at B1 and open that chart. Then, on "a command", go down to the next cell and open the next chart, and so on.
Any help appreciated. Thanks.

Private Sub Connection()

Dim LRow As Long

If WorksheetFunction.CountA(Cells) > 0 Then

'Search for any entry, by searching backwards by Rows.

LRow = Cells.Find(What:="*", After:=[B1], SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Row
End If

Dim ie As Object

Set ie = CreateObject("InternetExplorer.Application")
ie.Visible = True

Dim x As Integer
Dim item As String

With ie

'1 is default if starting from B1
For x = 1 To LRow

item = Cells(x, 2).Value 'go to column b (ABV, BHP, NAB, CLO, VBA, etc)

.navigate "//bigcharts.marketwatch.com/advchart/frames/frames.asp?symb=au%3A" & item _
& "&time=&freq="
Do While .busy: DoEvents: Loop
Do While .ReadyState <> 4: DoEvents: Loop


Next
End With
End Sub