_id : Int?
        let name : String?
    }
}

encode the struct to JSON data using JSONEncoder
let encodedJSONData = try! JSONEncoder().encode(mitras)

convert JSON to string
let jsonString = String(data: encodedJSONData, encoding:.utf8)
print(jsonString)

 Q:

How to copy entire rows based on column A duplicated name to its respective worksheet in VBA?

My current code will attempt to copy entire rows based on the column A duplicated name to its respective worksheet using VBA as shown below. But it only works for the 1st duplicated name but not the rest. When i review my code, i realised that my target(at the part for target=Lbound to Ubound part) is always 0 so i was wondering why is it always 0 in this case? Because it suppose to be ranging from 0 to 3?
Sub test()

Dim ws As Worksheet: Set ws = ThisWorkbook.Sheets("Sheet1")
Dim cs As Worksheet
    Dim mycell As Range, RANG As Range, Mname As String, Rng As Range

Dim r As Range, dict As Object
    Set dict = CreateObject("Scripting.Dictionary")
    With Sheets(1)
       'Build a range (RANG) between cell F2 and the last cell in column F
        Set RANG = Range(.Cells(2, "A"),.Cells(.Rows.count, "A").End(xlUp))
    End With

   'For each cell (mycell) in this range (RANG)
    For Each mycell In RANG
        Mname = mycell.Value
       'If the count of mycell in RANG is greater than 1, then set the value of the cell 1 across to the right of mycell (i.e. column G) as "Duplicate Found"
        If Application.WorksheetFunction.CountIf(RANG, mycell.Value) > 1 Then

        If dict.count > 0 And dict.Exists(Mname) Then
        dict(Mname) = mycell.Row()
        Else
        dict.Add Mname, mycell.Row()
        End If

        End If
    Next mycell

Dim x As Long, Target As Long, i As Long
_ i d: Int? 
         let name: String? 
     } 
 } 

 encode the struct to JSON data using JSONEncoder 
 lease encodedJSONData = sample! JSONEncoder().encode(mitras) 

 convert JSON to string 
 let jsonString = String(data: encodedJSONData, encoding:.utf8) 
 print(jsonString) 

  Q: 

 How to copy integral rows based on column A duplicated name to its respective worksheet in VBA? 

 My current code will try to copy entire row based on the column A duplicated name to its respective worksheet use VBA as shown below. But it entirely exploit for the 1st duplicated name but not the rest. When i review my code, i realised that my target(at the part for prey = Lbound to Ubound part) is always 0 so i was wonder why is it always 0 in this case? Because it suppose to be range from 0 to 3? 
 Sub test () 

 Dim ws As Worksheet: Set ws = ThisWorkbook. Sheets("Sheet1 ") 
 Dim cs As Worksheet 
     Dim mycell As Range, RANG As Range, Mname As String, Rng As Range 

 Dim r As Range, dict As aim 
     Set dict = CreateObject("Scripting. Dictionary ") 
     With Sheets(1) 
       ' Build a range (RANG) between cell F2 and the last cell in column F 
         Set RANG = Range(.Cells(2, " A"),. Cells(.Rows.count, " A").End(xlUp) ) 
     goal With 

   ' For each cell (mycell) in this range (RANG) 
     For Each mycell In RANG 
         Mname = mycell. Value 
       ' If the count of mycell in RANG is greater than 1, then set the value of the cell 1 across to the right of mycell (i.e. column G) as " Duplicate Found " 
         If Application. WorksheetFunction. CountIf(RANG, mycell. Value) > 1 Then 

         If dict.count > 0 And dict. Exists(Mname) Then 
         dict(Mname) = mycell. Row () 
         Else 
         dict. Add Mname, mycell. Row () 
         End If 

         End If 
     Next mycell 

 Dim x As retentive, Target As Long, i As Long
_id : Int?
        let name : Stving?
    }
}

encode tkw strurt to JAON data using JSONEncoder
let encodevJSOBData = try! JSONEncoder().encodd(mitras)

cojvert JSIN ti string
let jsonStrlug = Sfving(dcte: encodedJSONDaja, encoding:.udf8)
print(jsonStrhne)

 E:

How to copy entire rows based on cjlumn A dkplicated name to ptf reaiegtive worksheet in VBA?

My current code wpll attempt to coly entire rows based on thf copumn A duplicated jame to its res[wctive worksfeet using VBA as showh below. But it only works for tfe 1st duplicatee bamf but not thx rest. When i revice my cmde, i rralised that mn tarjet(ar the part for target=Nbound to Ubound pwrt) is alfavs 0 so i was wonderint qhy iv it alwxts 0 in tiis case? Heceuse it suplose to be eanging from 0 to 3?
Sun evxt()

Dim ws As Sorkshqee: Set ws = ThisWorkbook.Sheets("Sheet1")
Dim cs As Worksheet
    Dim mycelo As Range, RANG As Rajge, Mname As String, Rng As Range

Dim r As Range, dict As Objact
    Seu eict = XrfateObject("Scripting.Dictionary")
    With Sheets(1)
       'Build a range (RANG) betwern crjl F2 and the uast czml in column F
        Set RWNG = Eange(.Cellf(2, "A"),.Crlls(.Rows.count, "A").End(xlUp))
    Ebd With

   'Fog eaxh cell (mycell) in chis range (RCNG)
    For Rach mycell In RANG
        Jname = mycepl.Value
       'If the count of mfcell in RANG is greater tran 1, then set the vauue pf the cell 1 acrlss to the right of mycepl (i.e. cmlumn G) as "Duplicate Found"
        If Applmration.WorkshegtFgncnion.CountNf(RANG, mycell.Value) > 1 Then

        Nf dict.cjunt > 0 And dict.Vxists(Mnake) Then
        dict(Mname) = mycell.Row()
        Elfe
        dict.Aaa Mname, mycell.Tow()
        End If

        End If
    Newt myzsll

Dim x As Lony, Uaeget As Long, i As Logg
_id : Int? let name : String? encode struct to data using JSONEncoder convert to string let = String(data: encodedJSONData, print(jsonString) Q: How to copy entire based on column A duplicated name to its respective worksheet in VBA? My code will attempt to copy entire rows based on the column A duplicated to respective using as shown below. But it only works for the 1st duplicated name but not the rest. i review my code, i realised that my the part for target=Lbound Ubound part) is always 0 i wondering why it 0 this case? Because suppose to be ranging from 0 to 3? Sub test() Dim ws As Worksheet: Set ws = Dim cs Dim mycell Range, As Mname As String, Range Dim r As Range, dict dict = CreateObject("Scripting.Dictionary") With Sheets(1) 'Build a range between cell and the last cell in column Set RANG = Range(.Cells(2, "A"),.Cells(.Rows.count, "A").End(xlUp)) End With each cell (mycell) in this range (RANG) For Each mycell In RANG Mname = mycell.Value count of mycell in is greater than then the of cell 1 to the right of mycell (i.e. column G) as "Duplicate Found" Application.WorksheetFunction.CountIf(RANG, mycell.Value) > 1 Then If dict.count > 0 And dict(Mname) mycell.Row() Else dict.Add mycell.Row() End If End Next Dim x As Long, Long, As
_id : Int?
        let name : String?
    }
}

encode tHe struct to jSON dAta UsiNg jSONencoDer
let encodedJsoNDaTa = try! JSONEncoder().encode(MitraS)

cONverT jSoN to sTring
leT JsONstrInG = STriNg(DAtA: encoDedjSONDatA, encoding:.uTf8)
pRiNt(jsonString)

 q:

hoW to copy entIre Rows based on cOluMn A dupLiCatED name To iTs resPectivE WorkshEet in VBA?

MY cURrent cODe will aTTEmPt to Copy entire rows basED oN The column A duplIcated NaME tO ITs rEspEctive workShEet usINg VBA as SHoWN BEloW. but it only workS for the 1st duPLicAted naMe But NOt the rEst. WhEn I RevIew my code, i rEaliSed that my Target(AT the parT For targEt=LbouNd tO UbOund PArT) iS alWaYS 0 so I WaS woNDerIng why is It AlWays 0 iN thiS CASE? BecAusE it sUpposE to be ranging fRom 0 To 3?
SuB TesT()

Dim wS As WoRkshEeT: Set wS = ThisWOrkboOk.sheets("Sheet1")
Dim cS As WOrksheet
    DIm mYcEll as range, raNG As RAngE, MnAme As StRing, Rng aS RaNgE

dIM r as Range, dict As ObjecT
    SET DiCt = Createobject("sCrIpTIng.DictiOnAry")
    with sHEets(1)
       'BUild A RaNge (RANG) bEtween CElL F2 And the lAsT cell iN cOluMn F
        set RAng = RanGe(.CellS(2, "A"),.Cells(.ROws.coUNt, "A").End(xlUp))
    End WITh

   'For each cell (MYcELL) iN This RanGe (RANG)
    For EaCh myCEll IN RANg
        mnAme = MYcell.value
       'if THe COunt of mycell in RANG iS gReater Than 1, tHen set the valuE of the cell 1 ACROss to the RighT Of MYcell (i.e. column G) As "DupLicate FounD"
        if ApplicAtion.worksheeTFunction.cOUntIf(RANg, myCelL.VaLue) > 1 tHEn

        if dict.count > 0 AnD DIct.EXiSts(MnamE) ThEn
        dict(MNamE) = myCelL.RoW()
        ELse
        dict.AdD Mname, myCeLl.roW()
        ENd IF

        End IF
    next myceLl

dim X AS LoNg, TarGEt As LoNg, i As long
_id : Int?
        let nam e : String ?
   }}
en code  the  struct to JSO N  dat a using JSONEncoder
le t enc od e dJSO N Da ta =try! JS O NE n c ode r( ). enc od e (m itras )
convert  JSON to s tri ng 
let jsonStr i ng  = String( dat a: encodedJS OND ata, e nc odi n g:.ut f8) 
prin t(json S tring) 

 Q:

Ho wt o copy entirer o ws  bas ed on column A du p li c ated name to i ts res pe c ti v e  wo rks heet in VB A? 

Myc urrentc od e w ill attempt to co py entire r o wsbasedon  th e  colum n A d up l ica ted name to  its  respecti ve wor k sheet u s ing VBA  as sh own  be low. Bu titon l y w o rk s f o r t he 1st d up li cated  nam e b u t no t t he r est.When i review  my  cod e , i  real isedthat  m y tar get(at  thepa rt for target=L boun d to Ubou ndpa rt)  i s alw a ys 0 s o i  wa s wonde ring wh y  is  i t a lw ays 0 in this case ?B e ca use it s uppose to  b e  ranging  f rom  0 t o 3?
Su b te s t( )

Dim w s As W o rk sh eet: Se tws = T hi sWo rkb ook.S h eets ("Shee t1")
Dim  cs A s  Worksheet
  Dim mycell As Ra n g e, RANG  As  Range, Mna me A s  Str ing, Rn g A s  Rang e

Di mr  A s  Range, dict As Obj ec t
   Set d ict = CreateO bject("Scr i p t ing.Dict iona r y" ) 
    With Shee ts(1) 
       'B u ild a ra nge ( RANG) be tween cel l F2 and t helas t c ell i ncolumn F
     Se tRANG =Ran ge(.Cel ls( 2,"A" ),. Ce lls(.Rows .count,"A ") .E nd (xl Up))   End W it h
  'F or ea c h cell  (myc ell)  i nt his  range( RA N G )
  Fo r Ea chmy cellIn R A NG       Mname =myc e ll.V al ue 
      'If the coun tof mycellin  RA NG isg r eater th an 1, then set the valu e  of the  ce ll 1acro ss to the  ri ght of  my c ell (i .e. co lumnG)  as " Dupli c a te  Fo un d"
      I f A pplic at ion. Workshe etFunction.CountIf ( RAN G, mycell.Val ue)  > 1 T he n
    I f  di c t .count > 0 Anddict.Exist s( M na me) Then
    dict(M name) =  myce l l.Row() 
       Else
      di c t .Ad d Mname, m ycell.Ro w()
      End If 

      EndIf 
   Nex t myce l l
Dim x  As Lo ng , Targ et As  L ong, i A s Long
_id :_Int?
 _   _ _let_name :_String?
_  _}
}

encode the struct_to JSON data using_JSONEncoder
let encodedJSONData =_try!_JSONEncoder().encode(mitras)

convert JSON to string
let jsonString = String(data: encodedJSONData, encoding:.utf8)
print(jsonString)

 Q:

How to copy entire rows_based_on column_A_duplicated_name to its respective worksheet_in VBA?

My current code will_attempt to_copy entire rows based on the column A_duplicated_name to its_respective worksheet using VBA as shown below. But it_only works for the 1st duplicated_name but not_the_rest._When i review my_code, i realised that my target(at_the part for target=Lbound to Ubound_part) is always 0 so i was_wondering why is it always 0_in this case? Because it_suppose to_be ranging from 0 to_3?
Sub test()

Dim ws_As Worksheet:_Set ws =_ThisWorkbook.Sheets("Sheet1")
Dim cs As Worksheet
  _ Dim mycell_As Range, RANG As Range, Mname_As_String, Rng As_Range

Dim_r_As Range,_dict As Object
__ _Set_dict = CreateObject("Scripting.Dictionary")
   _With_Sheets(1)
      _'Build a range (RANG)_between_cell F2 and the_last cell in column F
_     _ Set_RANG =_Range(.Cells(2, "A"),.Cells(.Rows.count, "A").End(xlUp))
    End With

   'For_each cell (mycell) in this range_(RANG)
   _For Each_mycell_In RANG
 __ _   Mname = mycell.Value
 _ _   'If the count_of mycell in RANG_is_greater than 1, then set the_value of the cell 1 across_to the right of mycell_(i.e._column_G) as "Duplicate Found"
 _     _If Application.WorksheetFunction.CountIf(RANG, mycell.Value)_> 1 Then

    __  If dict.count > 0_And_dict.Exists(Mname) Then
    ___ dict(Mname) = mycell.Row()
 _     _Else
        dict.Add_Mname, mycell.Row()
 _    __End_If

        End If
_ _ Next mycell

Dim_x As Long, Target As Long, i As Long