Microsoft Excel 2010 [Closed]

Report
-
Posts
365
Registration date
Monday February 7, 2011
Status
Contributor
Last seen
September 30, 2013
-
Hello,
I would like to figure out how to get a web address that I use to get data from the internet to always use the date that I put in cell A1. Any suggestions? Thanks.



2 replies

Posts
365
Registration date
Monday February 7, 2011
Status
Contributor
Last seen
September 30, 2013
118
paste some sort of data here and re-explain your problem

Sub Macro1()
'
' Macro1 Macro
'

'
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://www.wunderground.com/history/airport/KCAO/2012/2/22/DailyHistory.html?req_city=Clayton&req_state=NM&req_statename=New+Mexico&format=1" _
, Destination:=Range("$C$17"))
.Name = _
"DailyHistory.html?req_city=Clayton&req_state=NM&req_statename=New+Mexico&format=1_1"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.We
bSelectionType = xlEntirePage

.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
End Sub

Here's the macro I put together. I need the date (2012/2/22) in the web address to = the date in A1.
Do you see what I'm after now? Thanks.
Posts
365
Registration date
Monday February 7, 2011
Status
Contributor
Last seen
September 30, 2013
118
replace this line
"URL;https://www.wunderground.com/?cm_ven=cgi 


by

"URL;https://www.wunderground.com/?cm_ven=cgi"&year(range("A1")&"/" &month(range("A1")&"/"&day(range("A1")&"2012/2/22/DailyHistory.html? 



hope it will solve your problem

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!