VBA simple one..

B

Brian

All I want to do is change this VBA program to look at a
cell in the worksheet for the address instead of what it
is doing now. Any ideas? Brian


With Selection.QueryTable
.Connection = _
"URL;http://football.fantasysports.yahoo.com/f2/47
95/2?week=2&stat1=S&stat2=W"
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "19"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
End Sub
 
T

Tom Ogilvy

set rng = Worksheets("sheet3").Range("A1")
With Selection.QueryTable
.Connection = _
"URL;" & rng.Value & "?week=2&stat1=S&stat2=W"
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "19"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
End Sub
 
G

Guest

Tom,

It is giving me an 'object required' error. hmm.. any
more ideas?

I need to
change "URL;http://football.fantasysports.yahoo.com/f2/47
to "URL;http://football.fantasysports.yahoo.com/f2/47
95/[VARIABLE IN WORKSHEET]?week=[VARIABLE IN WORKSHEET]
&stat1=S&stat2=W"

-----Original Message-----
set rng = Worksheets("sheet3").Range("A1")
With Selection.QueryTable
.Connection = _
"URL;" & rng.Value & "?week=2&stat1=S&stat2=W"
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "19"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
End Sub

--
Regards,
Tom Ogilvy

All I want to do is change this VBA program to look at a
cell in the worksheet for the address instead of what it
is doing now. Any ideas? Brian


With Selection.QueryTable
.Connection = _
"URL;http://football.fantasysports.yahoo.com/f2 /47
95/2?week=2&stat1=S&stat2=W"
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "19"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
End Sub


.
 
B

Bob Phillips

Is this what you mean?

set rng = Worksheets("sheet3").Range("A1")
With Selection.QueryTable
.Connection = _
"URL;http://football.fantasysports.yahoo.com/f2/4795/" & rng.Value &
"?week=" & rng.Value
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "19"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
End Sub

--

HTH

RP
(remove nothere from the email address if mailing direct)


Tom,

It is giving me an 'object required' error. hmm.. any
more ideas?

I need to
change "URL;http://football.fantasysports.yahoo.com/f2/47
to "URL;http://football.fantasysports.yahoo.com/f2/47
95/[VARIABLE IN WORKSHEET]?week=[VARIABLE IN WORKSHEET]
&stat1=S&stat2=W"

-----Original Message-----
set rng = Worksheets("sheet3").Range("A1")
With Selection.QueryTable
.Connection = _
"URL;" & rng.Value & "?week=2&stat1=S&stat2=W"
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "19"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
End Sub

--
Regards,
Tom Ogilvy

All I want to do is change this VBA program to look at a
cell in the worksheet for the address instead of what it
is doing now. Any ideas? Brian


With Selection.QueryTable
.Connection = _
"URL;http://football.fantasysports.yahoo.com/f2 /47
95/2?week=2&stat1=S&stat2=W"
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "19"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
End Sub


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top