chaoban888
Thành viên mới

- Tham gia
- 28/1/10
- Bài viết
- 42
- Được thích
- 8
Em có code như sau
Em muốn sửa code tự động lấy dữ liệu từ ngày 01-01-2012 đến hiện tại, dựa vào thay đổi số ngày trên url
và khi lấy dữ liệu mới thi xuống dòng để không đè lên dữ liệu cũ
Mã:
Sub Macro1()'
' Macro1 Macro
'
'
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://xoso.wap.vn/ket-qua-xo-so-mien-nam-xsmn-ngay-[B][COLOR=#ff0000]01-01-2012[/COLOR][/B].html", _
Destination:=Range("$A$1"))
.Name = "ket-qua-xo-so-mien-nam-xsmn-ngay-[COLOR=#ff0000][B]01-01-2012[/B][/COLOR]"
.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 = "2"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
End Sub
và khi lấy dữ liệu mới thi xuống dòng để không đè lên dữ liệu cũ
Lần chỉnh sửa cuối: