I am trying to get data from multiple pages to their own sheets via VBA but I am having an issue with the web address changing and my vba using the previous days input. Even though using the macro recorder was used to copy the web address that was updated the query uses the old info it saved from the previous day. The sheets are named Game1, Game2, ...etc, and all have the correct web address listed in cell Y1 which is also named Game1Web, Game2Web ...etc.
Sheets("Game1").Select
Range("AE1:BC2123").Select
Selection.QueryTable.Delete
Selection.ClearContents
Range("Z1").Select
Selection.Copy
Range("Y1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = _
"THIS IS WHERE THE PREVIOUS DAYS WEB ADDRESS IS BUT I CANNOT POST IT IN MY THREAD"
Range("AE1").Select
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;THIS IS WHERE THE PREVIOUS DAYS WEB ADDRESS IS BUT I CANNOT POST IT IN MY THREAD" _
, Destination:=Range("$AE$1"))
.Name = "1610"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlOverwriteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = True
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
The section that is giving me the trouble that I would like to pull in the data in Cell Y1 is:
ActiveCell.FormulaR1C1 = _
"THIS IS WHERE THE PREVIOUS DAYS WEB ADDRESS IS BUT I CANNOT POST IT IN MY THREAD"
Range("AE1").Select
With ActiveSheet.QueryTables.Add(Connection:= _
"THIS IS WHERE THE PREVIOUS DAYS WEB ADDRESS IS BUT I CANNOT POST IT IN MY THREAD" _
, Destination:=Range("$AE$1"))
I have already built the formula to get my web address correct but need to get that data into the query and not save the old data.....
Thanks
Bookmarks