Excel VBA help needed

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • illfuuptn
    SBR MVP
    • 03-17-10
    • 1860

    #1
    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.
  • the_mathman
    SBR Sharp
    • 01-04-11
    • 312

    #2
    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.
    Comment
    • illfuuptn
      SBR MVP
      • 03-17-10
      • 1860

      #3
      Originally posted by the_mathman
      You have many solutions.
      The easiest is the follow



      referr to me if it works.
      Thank you. It worked great.
      Comment
      • the_mathman
        SBR Sharp
        • 01-04-11
        • 312

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

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

        Comment
        SBR Contests
        Collapse
        Top-Rated US Sportsbooks
        Collapse
        Working...