Domanda

sto ricevendo una tabella dal web in Excel con il codice sottostante

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

Ma voglio anche ottenere il conteggio delle righe da quel tavolo che ho ottenuto. Allora come posso ottenere questo?

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

Soluzione

Perché non semplicemente usare qualcosa di simile Range("B3").CurrentRegion.Rows.Count ?
Nota che non puoi conoscere le righe # da scaricare prima di scaricarle e dal momento che stai usando .BackgroundQuery = True, non sai davvero quando il download è completo ...

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top