Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default How to import one section of data from internet?

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.

"qitrader888 " wrote in message
...
Using web query, how do i create a macro that will only import a section
of the web instead of the entire page. For example, I need to import
only the current stock data's high, low, close (FEB27) into my
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 Sub


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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to import one section of data from internet?

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

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I set up a macro to clear data from a section? bwerner53 Excel Discussion (Misc queries) 1 November 1st 09 05:35 PM
Import data from zip file through Internet Eric Excel Discussion (Misc queries) 3 December 4th 08 02:34 PM
How to import data from a zipped file through Internet? Eric Excel Discussion (Misc queries) 0 December 3rd 08 03:41 PM
Capture cross-section data kyoshirou Excel Discussion (Misc queries) 1 June 6th 07 07:29 AM
autofill formula to every section of data Jason Excel Discussion (Misc queries) 2 December 23rd 06 07:12 PM


All times are GMT +1. The time now is 11:36 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"