> On Thu, 29 Mar 2007 18:12:14 GMT, "Bob Smith"
> <usirsclt_No_Spamola_[ at ]earthlink.net> wrote:
>
>> Range("A1").Select
>> With Selection.QueryTable
>> .Connection = _
>>
>> "URL;
http://players.buzztime.com/bt_profile.php?pid=207853&tn=overall">> .WebSelectionType = xlSpecifiedTables
>> .WebFormatting = xlWebFormattingNone
>> .WebTables = """statsSummaryTable"",17"
>> .WebPreFormattedTextToColumns = True
>> .WebConsecutiveDelimitersAsOne = True
>> .WebSingleBlockTextImport = False
>> .WebDisableDateRecognition = False
>> .WebDisableRedirections = False
>> .Refresh BackgroundQuery:=False
>> End With
>
> You need to create a variable that reads the value of a cell, then use
> that
> variable in your URL.
>
> Dim sPID As String
>
> sPID = Range("Z1").Value
>
> With Range("A1").QueryTable
> .Connection = _
> "URL;
http://players.buzztime.com/bt_profile.php?pid=" & sPID &
> "&tn=overall"
> .WebSelectionType = xlSpecifiedTables
> .WebFormatting = xlWebFormattingNone
> .WebTables = """statsSummaryTable"",17"
> .WebPreFormattedTextToColumns = True
> .WebConsecutiveDelimitersAsOne = True
> .WebSingleBlockTextImport = False
> .WebDisableDateRecognition = False
> .WebDisableRedirections = False
> .Refresh BackgroundQuery:=False
> End With
>
> The user put their ID in Z1 (change as desired) and runs the macro, and
> all
> the URLs are updated to show the correct web query. You'll need to modify
> the .Conection= part like I did above for all of the With Blocks in your
> code.
>
> --
> Dick Kusleika
> Microsoft MVP-Excel
>
http://www.dailydoseofexcel.com