24小时热门版块排行榜    

查看: 109  |  回复: 1
当前主题已经存档。

idccu

木虫 (小有名气)

[交流] 【请教】多个网页导入excel中编码问题

小弟在网上找了个可将多个连续网页导入excel中的编码,

但是运行后只是重复将第一个网页导入,不知什么原因?请高手指点一下。

编码如下:
Sub Macro1()
Dim rows As Long, n As Long, url As String
url = "URL;http://my.taobao.com/mytaobao/ra ... ;snap_id=0#RateType"
Sheets("Sheet3".Select
Cells = ""
For n = 0 To 30000 \ 40
rows = [c65536].End(xlUp).Row + 1
Cells(rows, 1).Activate
With ActiveSheet.QueryTables.Add(Connection:=Replace(url, "@", n + 1), Destination:=Cells(rows, 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
Next
MsgBox "OK"
End Sub
碧潭沙~
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

sihao0564

铁杆木虫 (知名作家)

2楼2009-09-01 21:01:41
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 idccu 的主题更新
普通表情 高级回复(可上传附件)
信息提示
请填处理意见