Morning all,
i have the code below to fetch historic data but i cannot figure out how to manipulate it to bring back a forecast, any ideas?
i have the code below to fetch historic data but i cannot figure out how to manipulate it to bring back a forecast, any ideas?
Code:
Sub RetrieveWeather()
Dim myYear As Integer
Dim myMonth As Integer
Dim myDay As Integer
Dim mySite As String
Dim myCity As String
Dim myState As String
Dim myStateName As String
myYear = Year(Date)
myMonth = Month(Date)
myDay = Day(Date - 1)
mySite = "EGNX"
myCity = "Derby"
myState = "United kingdom"
myStateName = "United Kingdom"
With Worksheets("Weather").QueryTables.Add(Connection:= _
"URL;http://www.wunderground.com/history/airport/" & mySite & "/" & myYear & "/" & myMonth & "/" & myDay & "/DailyHistory.html?req_city=" & myCity & "&req_state=" & myState & "&req_statename=" & myStateName _
, Destination:=Worksheets("Weather").Range("$A$1"))
.Name = _
"DailyHistory.html"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = """obsTable"""
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
ThisWorkbook.Sheets("Sheet 1").Select
End With
End Sub