Results 1 to 4 of 4

Macro URL syntax error

Threaded View

  1. #1
    Registered User
    Join Date
    07-26-2016
    Location
    Virginia
    MS-Off Ver
    2016
    Posts
    11

    Macro URL syntax error

    Hello,

    With this code:

    With ActiveSheet.QueryTables.Add(Connection:= _
            "URL;http://finance.yahoo.com/quote/LUV/key-statistics", Destination:=Range("$A$1"))
    I want to change LUV into this....

    & Range("a1").Value

    So I can get any stock but I cant get the syntax to work. Any ideas please?


    Also I've been using this code:

    With ActiveSheet.QueryTables.Add(Connection:= _
            "URL;http://finance.yahoo.com/quote/" & Range("a1").Value, Destination:=Range("$A$2"))
    And it has worked for me, but I wanted to use data from the stocks "key statistics" page but again cant seem to be able to add changes (such as & Range("a1").Value) into the middle of the url

    I hope this makes sense

    Thanks for reading
    Last edited by JBeaucaire; 07-26-2016 at 10:13 AM. Reason: Added missing CODE tags, please read and follow the Forum Rules, link above in the menu bar. Thanks.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Macro Syntax Error?
    By 43Sean in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-16-2014, 04:57 PM
  2. Excel macro (compile error. syntax error.) error
    By salar_younis in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-06-2014, 06:11 AM
  3. [SOLVED] first timer using VB to cut and paste macro - getting compile error syntax error
    By jopedder in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-24-2013, 11:45 AM
  4. basic macro syntax error..
    By ashish1044 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-08-2013, 05:11 AM
  5. Macro Syntax Error
    By zyxw in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-21-2013, 04:15 AM
  6. UDF, Subsequent macro syntax error
    By JapanDave in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-06-2012, 08:14 AM
  7. Syntax error in 9-line macro ..?
    By thh3 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-30-2008, 06:31 PM

Tags for this Thread

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