What I'm doing here is parsing a JSON file into a worksheet. The JsonConverter example shows it looking through a defined list of "values":
I've created a string array that holds each of the values I need (DirArray) instead of separate "a", "b", "c", and I've got a count of how many items there are (c), but I'm not sure how to loop through each of these inside the For Each statement. I've gotten this far, but I know it's wrong:
Any help would be super.
Code:
' Prepare and write values to sheetDim Values As Variant
ReDim Values(Parsed("values").Count, 3)
Dim Value As Dictionary
Dim i As Long
i = 0
For Each Value In Parsed("values")
Values(i, 0) = Value([COLOR=#ff0000]"a"[/COLOR])
Values(i, 1) = Value([COLOR=#ff0000]"b"[/COLOR])
Values(i, 2) = Value([COLOR=#ff0000]"c"[/COLOR])
i = i + 1
Next Value
I've created a string array that holds each of the values I need (DirArray) instead of separate "a", "b", "c", and I've got a count of how many items there are (c), but I'm not sure how to loop through each of these inside the For Each statement. I've gotten this far, but I know it's wrong:
Code:
n = 1
i = 0
Do While n <= c
ArrItem = (DirArray(1, n))
For Each Value In Parsed(parent)
Values(i, 0) = Value(ArrItem)
i = i + 1
Next Value
n = n + 1
Loop
Any help would be super.
Last edited: