title: Parsing Json array via VBA
body: <p>I am getting a json response from an api and parse it to update in excel. Below is the code. I am not able to parse further to get the price info. </p>
  
  <pre><code>Dim strResult As String
  Dim objHTTP As Object
  Dim URL As String
  Set objHTTP = CreateObject("WinHttp.WinHttpRequest.5.1")
  URL = "https://bitbns.com/order/getTickerAll"
  objHTTP.Open "GET", URL, False
  objHTTP.Send
  Set JSON = JsonConverter.ParseJson(objHTTP.ResponseText)
  'strResult = objHTTP.ResponseText
  'MsgBox JSON(1)("BTC")("sellPrice")
  baseCol = 9
  buyCol = 10
  sellCol = 11
  i = 1
  Dim keyCurr As String
  For Each Item In JSON
      ActiveSheet.Cells(i + 2, baseCol).Value = Item.Keys
      i = i + 1
  Next
  </code></pre>
  
  <p>Kinly help. As you could see in a comment above, I am able to get data as hard coded</p>
  
  <pre><code>MsgBox JSON(1)("BTC")("sellPrice")
  </code></pre>
  
  <p>But when I try getting that in loop, I am unable to. Below are the ones I tried but did not work.</p>
  
  <pre><code>ActiveSheet.Cells(i + 2, baseCol).Value = JSON(i)(Item.Keys)("sellPrice") 
  ActiveSheet.Cells(i + 2, baseCol).Value = JSON(i)(" + Item.Keys + ")("sellPrice")
  ActiveSheet.Cells(i + 2, baseCol).Value = JSON(i)(Item(0))("sellPrice")
  ActiveSheet.Cells(i + 2, baseCol).Value = JSON(i)(Item(1))("sellPrice")
  </code></pre>
  
  <p>For parsing JSON, I use <a href="https://github.com/VBA-tools/VBA-JSON" rel="nofollow noreferrer">vbaJSON</a> library. It seem to return proper object (as could see am able to access hard coded way, but could not access in loop)</p>
  
  <p><strong>Update</strong>: As per Vityata's hint, below code seem to be working fine. Thank you all for such immediate help. :)</p>
  
  <pre><code>For Each Item In JSON
      ActiveSheet.Cells(i + 2, baseCol).Value = Item.Keys
      For Each curr In Item
          ActiveSheet.Cells(i + 2, buyCol).Value = JSON(i)(curr)("buyPrice")
          ActiveSheet.Cells(i + 2, sellCol).Value = JSON(i)(curr)("sellPrice")
          i = i + 1
      Next curr
  Next Item
  </code></pre>