+ Reply to Thread
Results 1 to 2 of 2

Paste string on a cell to New Web Query URL

  1. #1
    Registered User
    Join Date
    05-19-2006
    Posts
    2

    Paste string on a cell to New Web Query URL

    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...

  2. #2
    Don Guillett
    Guest

    Re: 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
    [email protected]
    "vovlov" <[email protected]> wrote in
    message news:[email protected]...
    >
    > 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
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1