Evening,
I must be doing something really wrong with the code as itsnot working for me to change the fields of Location, Date before downloading aQuery from website. I have shared the sheet in Google Drive if somebody canhelp please?
http://www.realtimetrains.co.uk/sear...=all&order=wtt
Mainsheet highlighted in YELLOW connected with above red
https://drive.google.com/file/d/16ZN...ew?usp=sharing
Sub Macro1()
Dim locstr As String
Dim yearstr As String
Dim daystr As String
Dim monthstr As String
locstr = Sheets("Sheet2").Range("A1").Value
yearstr = Sheets("Sheet2").Range("A2").Value
daystr = Sheets("Sheet2").Range("A3").Value
monthstr = Sheets("Sheet2").Range("A4").Value
With ActiveSheet.QueryTables(1)
.Connection = "URL;http://www.realtimetrains.co.uk/search/advanced/" & locstr & "/" & yearstr & "/" & daystr & "/" & monthstr & "/0000-2359?stp=WVS&show=all&order=wtt"
.Refresh
End With
End Sub
Bookmarks