I am trying to convert the excel data into below JSON format but my code is not converting this is in accurate format. You help will be much appreciated.

There is extra [ in the format how to achieve this with Excel VBA.

**The Excel Data**

[ExcelData](https://docs.google.com/spreadsheets/d/1dj-Qrv4wqb4F2YzHwZR9pO-8lXXg-LzrLs_QfebCqMU/edit?usp=sharing)

**Required JSON Format**

[JSON Format](https://jsonblob.com/7e4b66bf-f75a-11eb-825b-45458430f026)

**My code**

```
    Public Function ToJSON(rng As Range) As String
    ' Make sure there are two columns in the range
    If rng.Columns.Count < 2 Then
        ToJSON = CVErr(xlErrNA)
        Exit Function
    End If

    Dim dataLoop, headerLoop As Long
    ' Get the first row of the range as a header range
    Dim headerRange As Range: Set headerRange = Range(rng.Rows(1).Address)

    ' We need to know how many columns are there
    Dim colCount As Long: colCount = headerRange.Columns.Count

    Dim json As String: json = "["

    For dataLoop = 1 To rng.Rows.Count
        ' Skip the first row as it's been used as a header
        If dataLoop > 1 Then
            ' Start data row
            Dim rowJson As String: rowJson = "{"

            ' Loop through each column and combine with the header
            For headerLoop = 1 To colCount
                rowJson = rowJson & """" & headerRange.Value2(1, headerLoop) & """" & ":"
                rowJson = rowJson & """" & rng.Value2(dataLoop, headerLoop) & """"
                rowJson = rowJson & ","
            Next headerLoop

            ' Strip out the last comma
            rowJson = Left(rowJson, Len(rowJson) - 1)

            ' End data row
            json = json & rowJson & "},"
        End If
    Next

    ' Strip out the last comma
    json = Left(json, Len(json) - 1)

    json = json & "]"

    ToJSON = json
End Function

```