View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Don Guillett
 
Posts: n/a
Default Paste string on a cell to New Web Query URL

I assume you want to change the symbol? You can use this idea where cell a1
contains SSL

With ActiveSheet.QueryTables.Add(Connection:= _
_-\"URL;http://finance.yahoo.com/q?s=SSL\"-_,


With ActiveSheet.QueryTables.Add(Connection:= _
_-\"URL;http://finance.yahoo.com/q?s=" & [a1] & "\"-_,

Also, you probably?? only need a few parameters

..BackgroundQuery = True
..TablesOnlyFromHTML = False
..Refresh BackgroundQuery:=False
..SaveData = True


Be aware that doing it the way you are will build a new defined name with
each trip to the site so you will need to incorporate something like. If
other named cell, exclude them.

For Each Name In Sheets("Data").Names
Name.Delete
Next Name


Goto this web site and get some of the free files there such as my
YahooMultipleQuotes 'to get many at once
Look for mine under author donalb36
To visit your group on the web, go to:
http://groups.yahoo.com/group/xltraders/


--
Don Guillett
SalesAid Software

"vovlov" wrote in
message ...

Hi!

I want to be able to copy an URL address to the New Web Query address
bar, by editing this macro:

---------------------------------
With ActiveSheet.QueryTables.Add(Connection:= _
_-\"URL;http://finance.yahoo.com/q?s=SSL\"-_,
Destination:=Range("H15"))
Name = "q?s=SSL_7"
FieldNames = True
RowNumbers = False
FillAdjacentFormulas = False
PreserveFormatting = True
RefreshOnFileOpen = False
BackgroundQuery = True
RefreshStyle = xlInsertDeleteCells
SavePassword = False
SaveData = True
AdjustColumnWidth = True
RefreshPeriod = 0
WebSelectionType = xlSpecifiedTables
WebFormatting = xlWebFormattingNone
WebTables = "15"
WebPreFormattedTextToColumns = True
WebConsecutiveDelimitersAsOne = True
WebSingleBlockTextImport = False
WebDisableDateRecognition = False
WebDisableRedirections = False
Refresh BackgroundQuery:=False
End With
--------------

I want to be able to change the URL according to a string on a cell...


--
vovlov
------------------------------------------------------------------------
vovlov's Profile:
http://www.excelforum.com/member.php...o&userid=34596
View this thread: http://www.excelforum.com/showthread...hreadid=543901