#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,560
Default Web Query question

Hi Don,

you are great, it works like a charm, not only i was able to figure out the
separator, and also you macro gave me better ideas, once again thank you

David

"Don Guillett" wrote:

Try this or send your file to me at the address below
Sub GetOptionsSAS()'Use to establish the query
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://finance.yahoo.com/q/op?s=" & _
Range("b1") & "&m=" & Range("c1") & "", _
Destination:=Range("A3"))
.Refresh BackgroundQuery:=False
End With
End Sub
Name the sheet Options
Use below to refresh with different symbols in b1 and different months in
c1. Do NOT use the first one again.
Sub RefreshWithVariablesSAS()'Assign to a button on your sheet
With Sheets("Options").QueryTables(1)
.Connection = "URL;http://finance.yahoo.com/q/op?s=" & Range("b1") &
"&m=" & Range("c1")
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingAll
.WebTables = "11,14,15,16,19"
'.WebPreFormattedTextToColumns = False
'.WebConsecutiveDelimitersAsOne = False
'.WebSingleBlockTextImport = False
'.WebDisableDateRecognition = False
'.WebDisableRedirections = True
.Refresh BackgroundQuery:=False
End With
End Sub
If I can be of further assistance, contact me privately at the address below

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"David" wrote in message
...
I am trying to download stock options through the following vba code,
however
i am having problem with separator between "m" field which is month and
"s"
field which is stock symbol, I appreciate any help i can get,

With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://finance.yahoo.com/q/op?s=" &
Range("b1").Value;&m=2010-05", Destination:=Range("$A$11"))

thanks
david


.

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
One Last Query Question carla 7 Excel Discussion (Misc queries) 0 July 31st 08 02:55 PM
Web Query question sb1920alk Excel Discussion (Misc queries) 3 May 25th 08 08:43 PM
MS Query question shmurphing Excel Worksheet Functions 0 February 2nd 07 03:28 AM
Web Query question Alex Excel Discussion (Misc queries) 1 May 23rd 06 06:17 PM
Web Query Question superspiker Excel Discussion (Misc queries) 0 April 24th 06 12:06 AM


All times are GMT +1. The time now is 03:06 AM.

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

About Us

"It's about Microsoft Excel"