1. #1
    illfuuptn
    illfuuptn's Avatar Become A Pro!
    Join Date: 03-17-10
    Posts: 1,860

    Excel VBA help needed

    Say I wanted to do a web query of a fictional website called sports.com/lookup?

    But after the word "lookup" I want to insert the value from A1. IOW if the word in A1 is "player" then the web query that I want searched should be sports.com/lookup?player

    If I record a macros of me simply going to sports.com/lookup? then the relevant part looks like this:

    With ActiveSheet.QueryTables.Add(Connection:= _
    "URL;http://www.sports.com/lookup?", Destination:=Range("$A$4"))
    What do I do so that it adds A1 to the URL?

    Thank you for any help.

  2. #2
    the_mathman
    the_mathman's Avatar Become A Pro!
    Join Date: 01-04-11
    Posts: 312
    Betpoints: 2360

    You have many solutions.
    The easiest is the follow

    With ActiveSheet.QueryTables.Add(Connection:= _
    "URL;http://www.sports.com/lookup?" & Range("A1").Value , Destination:=Range("$A$4"))
    referr to me if it works.
    Points Awarded:

    illfuuptn gave the_mathman 2 SBR Point(s) for this post.


  3. #3
    illfuuptn
    illfuuptn's Avatar Become A Pro!
    Join Date: 03-17-10
    Posts: 1,860

    Quote Originally Posted by the_mathman View Post
    You have many solutions.
    The easiest is the follow



    referr to me if it works.
    Thank you. It worked great.

  4. #4
    the_mathman
    the_mathman's Avatar Become A Pro!
    Join Date: 01-04-11
    Posts: 312
    Betpoints: 2360

    perfect!
    thank you for the 'gift' :-)

    with excel is possible to make many interesting things....


Top