What is the definition of "correctedcode"?
Try replace "Private Sub GetDetails" with following code and see how it goes.
Private Sub GetDetails(ByVal txt As String, myKey, dic As Object, flg As Boolean)
Dim m As Object, e
With CreateObject("VBScript.RegExp")
.Global = True
.Pattern = """description"": *""(.+?)"".*[\r\n]+.*""dCode"": *""(.+?)"""
For Each m In .Execute(txt)
If flg Then
dic(myKey)(m.submatches(0)) = m.submatches(1)
Else
If dic(myKey).exists(m.submatches(0)) Then
If dic(myKey)(m.submatches(0)) <> m.submatches(1) Then
dic(myKey)("correctedcode") = dic(myKey)("correctedcode") & _
IIf(dic(myKey)("correctedcode") <> "", ", ", "") & dic(myKey)(m.submatches(0))
End If
dic(myKey).Remove m.submatches(0)
Else
dic(myKey)("addedcode") = m.submatches(1)
End If
End If
Next
End With
If Not flg Then
For Each e In dic(myKey)
Select Case e
Case "Billid", "Ctextid", "codername", "correctedcode", "addedcode", "deletedcode"
Case Else
dic(myKey)("deletedcode") = dic(myKey)("deletedcode") & _
IIf(dic(myKey)("deletedcode") <> "", ", ", "") & dic(myKey)(e)
End Select
Next
End If
End Sub
Bookmarks