excelthong
Active Member
- Joined
- Jul 13, 2006
- Messages
- 313
Code:
Sub Import()
'
ThisURL = "URL;" & Range("a1").Value
With ActiveSheet.QueryTables.Add(Connection:= _
ThisURL, Destination:=Range("A2"))
.Name = "Hamilton_1519"
'.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 = "9"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = True
.WebDisableRedirections = True
.Refresh BackgroundQuery:=False
End With
End Sub
hi i have the code above to import the url in range("a1")
however when i type a new url in A1 and run this macro again, everything will be shifted to right, url in A1 now moved to M1
so may i know what code should i change so that the content is refresh at A2 and not move everything to M1?
thank you