Public Sub exceltojson(lang_id) 'lang_id : 1 = fr; 2 = en Dim rng As Range, items As New Collection, myitem As New Dictionary, i As Integer, cell As Variant Dim jsonDic As Dictionary Set rng = Range(Application.ActiveSheet.Range("A2"), Application.ActiveSheet.Range("A2").End(xlDown)) Set jsonDic = New Dictionary lang = Array("French", "English", "Portuguese", "Spanish", "Russian", "SimplifiedChinese", "TraditionalChinese", "German") Call replaceText(1, lang_id) i = 0 For Each cell In rng If Not IsEmpty(cell.Value) And Not (cell.Offset(0, lang_id).Value = "/") Then myitem("key") = cell.Value If Not IsEmpty(cell.Offset(0, lang_id).Value) Then myitem("value") = cell.Offset(0, lang_id).Value items.Add myitem Set myitem = Nothing i = i + 1 Else myitem("value") = "" items.Add myitem Set myitem = Nothing i = i + 1 End If End If Next jsonDic.Add "items", items myfile = Application.ActiveWorkbook.Path & "\" + lang(lang_id - 1) + "\" + lang(lang_id - 1) + "_" + Application.ActiveSheet.Name + ".json" Set objStream = CreateObject("ADODB.Stream") With objStream .Type = 2 .Charset = "utf-8" .Open .WriteText ConvertToJson(jsonDic, Whitespace:=2) 'JSON_Exporter library call .SaveToFile myfile, 2 .Close End With Call replaceText(2, lang_id) End Sub Public Sub replaceText(id, columnid) 'Set string to replace from and to replace to (first in array is replace with first in second array, etc) 'Used to replace easy to write tags (such as "/mp/" for physical mastery) to TextMeshPro tags set up in Unity ( for physical mastery) stringToReplace = Array("/title/", "/de/", "/dp/", "/re/", "/rp/", "/me/", "/mp/", "/hp/", "/vel/", "/str/", "/vision/", "/cc/", "/state/", "/skill/", "/cd/", "/u/", "/d/", "/tRange/", "/tCD/", "//") stringReplacement = Array("", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "") If id = 1 Then 'Replace Return Carriage to \n Application.ActiveSheet.Columns(columnid + 1).Replace what:=vbLf, Replacement:="\n", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False 'Replace all string from the stringToReplace array j = 0 For Each a In stringToReplace Application.ActiveSheet.Columns(columnid + 1).Replace what:=a, Replacement:=stringReplacement(j), LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False j = j + 1 Next Else 'Revert replacement not to alter the excel cells Application.ActiveSheet.Columns(columnid + 1).Replace what:="\n", Replacement:=vbLf, LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False j = 0 For Each a In stringReplacement Application.ActiveSheet.Columns(columnid + 1).Replace what:=a, Replacement:=stringToReplace(j), LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False j = j + 1 Next End If End Sub