![]() ![]() ![]() In this VBA code, we have defined a function named ExcelToJSON that will later be used in an Excel file for the conversion of Excel to JSON. Public Function ExcelToJSON(rng As Range) As String ‘ Check there must be at least two columns in the Excel file If 1 Then ‘ Start data row Dim jsonData As String: jsonData = “,” End If Next ‘ Strip out the last comma in last row of the Excel data JSON = Left(JSON, Len(JSON) – 1) JSON = JSON & “]” ExcelToJSON = JSON End Function Copy this following code and paste this to your respective VBA code editor. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |