0

I'm struggling to find any resources on how to successfully format this data accordingly. enter image description here

I have the json string, but at this point I can only insert it into a message box, and I have not in the slightest clue how to move forward.

I've seen people do something like this, but I would appreciate some guidance to get to that point. Thanks in advance.


ws.Cells(1, 1) = "Induct"
ws.Cells(1, 2) = "Rebin"
ws.Cells(1, 3) = "Pack"

For Each item In jsonObject
    ws.Cells(i, 1) = item("Induct")
    ws.Cells(i, 2) = item("Rebin")
       ws.Cells(i, 3) = item("Pack")
    i = i + 1
Next```
j johns
  • 39
  • 5
  • 1
    Please edit your question to show the actual JSON - it's easier to parse than the screenshot you have there. Basic approach would be to use the VBA-JSON library (https://github.com/VBA-tools/VBA-JSON) to parse the json, then follow the same sort of steps you show in your code. Plenty of examples here: if you run into a specific problem then update your code and add an explanation of the problem you're having. – Tim Williams May 03 '22 at 21:07
  • There's no such thing as an Excel string. – Joel Coehoorn May 03 '22 at 21:57
  • 1
    Eg: see https://stackoverflow.com/questions/61999980/parsing-json-in-excel-vba-and-access-array-by-key or https://www.google.com/search?q=JsonConverter.ParseJson+site%3Astackoverflow.com – Tim Williams May 03 '22 at 22:35
  • @JoelCoehoorn I'm sorry? lol – j johns May 03 '22 at 22:41
  • @JoelCoehoorn Oh I see lol, I just needed to add words to my question because of "Similar Questions have been asked." I guess I just kinda blurbed something out – j johns May 03 '22 at 22:42
  • I wrote [PrintJSONAccessors](https://stackoverflow.com/a/51128453/9912714) to print the code needed to access the data produced using [JsonConverter](https://github.com/VBA-tools/VBA-JSON/blob/master/JsonConverter.bas). – TinMan May 03 '22 at 23:45

0 Answers0