Im trying to use a macro to copy a website in a cell and then open "get external data from web", paste it in the url box, and then import the data.
It works while I'm recording it but when I change the website, it copies and pastes the old one instead. What am I doing wrong?
Thanks!!
Heres the Macro Code
Range("G26").Select ***Its here where even when G26 changes it doesnt change in the clipboard***
ActiveWorkbook.Worksheets.Add
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;https://www.linkedin.com/company/facebook", Destination:=Range("$A$1"))
.Name = "facebook"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
Bookmarks