繁体   English   中英

如何查找从Web粘贴到Excel的表的RowCount

[英]How to find RowCount of a table which pasted from web to excel

我用下面的代码从Excel中的Web接收到一个表

With ActiveSheet.QueryTables.Add(Connection:= _
    "URL;some url")
    .WebSelectionType = "xlSpecifiedTables"
    .WebTables = "10"
    .BackgroundQuery = True
    .TablesOnlyFromHTML = True
    .Refresh BackgroundQuery:=False
    .SaveData = True
End With

但是我也想从那张桌子上得到行数。 那我该如何实现呢?

With ActiveSheet.QueryTables.Add(Connection:= _
    "URL;some url")
    .LineCount 'is it smt like this???????
End With

为什么不简单使用Range("B3").CurrentRegion.Rows.Count呢?
请注意,在实际下载#行之前您不知道要下载的#行,并且由于您使用的是.BackgroundQuery = True ,因此您实际上并不知道下载何时完成...

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM