In my worksheet, i have two sheets. Sheet2 has a list of URLs of JSON files which i will use to extract data from. Sheet1 will be where the JSON data will be extracted to.
I'm using a loop like below to extract the data sets. However, the data sets all vary in size so i need to know which loop number each set belongs to. Knowing the loop number will allow me to figure out which URL it belongs too.
Is there a way i can do that? Or is there a way maybe i can just print the URL from Sheet2 to the appropriate set?
Hope that makes sense...
I'm using a loop like below to extract the data sets. However, the data sets all vary in size so i need to know which loop number each set belongs to. Knowing the loop number will allow me to figure out which URL it belongs too.
Is there a way i can do that? Or is there a way maybe i can just print the URL from Sheet2 to the appropriate set?
Hope that makes sense...
Code:
For x = 1 To Application.CountA(Sheet2.Columns(1))
URL = Sheets(2).Cells(x, 1)
objHTTP.Open "GET", URL, False
objHTTP.Send
If objHTTP.ReadyState = 4 Then
If objHTTP.Status = 200 Then
Set RetVal = MyScript.Eval("(" & objHTTP.responseText & ")")
objHTTP.abort
Set MyList1 = RetVal.result.buy
NoA = Sheet1.Cells(65536, 1).End(xlUp).Row + 1
For Each myData In MyList1
Sheets(1).Cells(NoA, 1).Value = myData.Quantity
Sheets(1).Cells(NoA, 2).Value = myData.Rate
NoA = NoA + 1
Next
Next