View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
qitrader888[_6_] qitrader888[_6_] is offline
external usenet poster
 
Posts: 1
Default How to import one section of data from internet?

Using web query, how do i create a macro that will only import a sectio
of the web instead of the entire page. For example, I need to impor
only the current stock data's high, low, close (FEB27) into m
spreadsheet.

Thanks

Here is my code.

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("C3")) Is Nothing Then
Exit Sub
Else

Dim CoSym As String

CoSym = Worksheets("Main").Range("C3").Value

With Sheets("Stock 1").QueryTables(1)
.Connection = _
"URL;http://table.finance.yahoo.com/k?s=" & CoSym
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingAll
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = True
.WebDisableDateRecognition = False
.WebDisableRedirections = True
.Refresh BackgroundQuery:=False
End With

End If
End Su

--
Message posted from http://www.ExcelForum.com