View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Parameter in a web query

http://www.nba.com/schedules/index.h...edate=20090205
"http://www.nba.com/schedules/index.html?gamedate=" & range("a1")
or some other variable.

Sub nbavariable()
mydate = 20090206

With Sheets("sheet1").QueryTables(1)

.Connection = _
"URL;http://www.nba.com/schedules/index.html?gamedate=" & mydate
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingAll
.WebTables = """scheduleTable"""
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Jai" wrote in message
...
I am currently running web query to retrieve a table from the NBA website
using
http://www.nba.com/schedules/index.h...edate=20090205 ,
where the date at the end changes from day to day. I have no idea how to
use
a parameter for a web query. Would greatly appreciate any help anyone can
provide. Thanks, Jai