I am trying to run a macro where the web query refers to a cell in another worksheet. The Macro is below - I get an error with Refresh BackgroundQuery:=False
Sub sep_48hr()
'
' sep_48hr Macro
'
' Keyboard Shortcut: Ctrl+j
'
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;" & Range("Sheet2!A7").Value _
, Destination:=Range("$A$1"))
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlAllTables
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
Columns("I:CZ").Select
Selection.Delete Shift:=xlToLeft
Range("A1").Select
End Sub
Can anyone assist?
Bookmarks