title: Convert range to json array
body: <p>In excel VBA, how do i write a custom function to convert a range to json array?</p>
  <p>I have only the function signature for now:</p>
  <pre><code>Function to_json(input As Range)
  
  End Function
  </code></pre>
  <p>I need to convert the input to a json array in the following former</p>
  <pre><code>[
    [4,&quot;foo&quot;],
    [&quot;bar&quot;,5]
  ]
  </code></pre>
  <p>how do i it?</p>
  <p>The end goal it to post the json to a web service, get response in a similar format and return it as range object</p>
  <p>Edit: the input range can include any combination of of numbers and strings. I need to copy these to a 2 dimensional json array  as shown in the example. note that i need json array and not json objects.</p>
  <p>i googled for a while, but couldn't find any obvious answer</p>
  <p>edit2: in js, the answer is very simple: JSON.stringify(input), is there a simple vba equivalent?</p>