Vba excel count all rows from a web query
Clash Royale CLAN TAG#URR8PPP
Vba excel count all rows from a web query
I want to be able to count the number of rows in the csv and use that number of rows in the loop to add the number of formatted table/border rows enclosing the data. Basically I have a formatted border. I
The data is from an api/url
The data looks like this illustration
A,B,C,D
1,2,3,4
2,3,5,6
3,4,6,8
I have this code but it doesnt work it counts all the rows
Dim count As Long
count = Cells(Rows.count, ActiveCell.Column).End(xlUp).Row - ActiveCell.Row
For x = 1 To count
Cells(counter, 2).EntireRow.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromRightOrAbove
ActiveCell.EntireRow.Copy
Application.CutCopyMode = False
Next x
''Next Steps after
'Url
'Query Table
With Sheets(1).QueryTables.Add(Connection:="URL;" & apiURL, Destination:=ActiveCell.Offset(0, 0))
.BackgroundQuery = True
.TablesOnlyFromHTML = False
.Refresh BackgroundQuery:=False
.SaveData = True
'Text to Columns
And why does it crash when it reaches a certain number of records like 3000 when I copy and paste the formatted border and query the api. I have to put an application wait in the query table
Application.Wait(Now + TimeValue())
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.