excel中提取单元格数据,然后导入相应web页面上数据的问题。

DimiAsInteger'fori=ActiveCell.Offset(,-1)WithActiveSheet.QueryTables.Add(Connection:=... Dim i As Integer
'for i=ActiveCell.Offset(, -1)
With ActiveSheet.QueryTables.Add(Connection:= _
"URL; http://basic.10jqka.com.cn/" & i & "/cwtable/Important_year.html", _
Destination:=ActiveCell)脑子里随便想想出来的。。不知道正确的应该是怎样?而且。。for i 前面如果去掉'会显示缺少to 但网上查到的都是没有'的。。
展开
 我来答
匿名用户
2013-09-13
展开全部
举个类似的例子,希望对你有帮助 Private Sub CommandButton1_Click()k3dshijihao = " http://www.17500.cn/getData/3d.TXT"d3s = "WData3D_All" Cells(2, 1) = "开奖期号"
Cells(2, 2) = "开奖日期"
Cells(2, 3) = "开"
Cells(2, 4) = "奖"
Cells(2, 5) = "号" Cells(2, 6) = "试"
Cells(2, 7) = "机"
Cells(2, 8) = "号" Cells(2, 9) = "机"
Cells(2, 10) = "球" Cells(2, 11) = "投注总额" Cells(2, 12) = "单选注数"
Cells(2, 13) = "金额" Cells(2, 14) = "组三注数"
Cells(2, 15) = "金额" Cells(2, 16) = "组六注数"
Cells(2, 17) = "金额"
cz = k3dshijihao: czmc = d3s
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;" & cz, Destination:=Range("A3"))
.Name = czmc
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = xlWindows
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = True
.TextFileTabDelimiter = False
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = True
.TextFileColumnDataTypes = Array(1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
Range("A" & (Application.Count(Range("a1:a3000")))).Select
End
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式