How to import one section of data from internet?

Q

qitrader888

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
 
S

Shatin

Which version of Excel are you using? I am using v. 2003, when I want to
import a web page, there are arrows at the top left hand corner of each
table. By checking those arrows, I can easily choose to import the entire
page or just sections of I want.
 
Q

qitrader888

I'm running Excel 2003. I want to gather specific data from that box. I
my case, it would be to only gather the most current information
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top