giải thích đoạn code sau: Sub capnhatKetqua()
Dim http As New XMLHTTP60, html As New HTMLDocument
Dim resT As Object, resR As Object, cll As Object
Dim eNs
Dim result() As String
Dim cnd As Boolean
Dim hd, rws
Dim i, j, k, x, z, t
With Sheet1
    If .Range("J2") < .Range("J1") Then
        cnd = True
    Else
        If .Range("J2") = .Range("J1") And .Range("I1") >= 18 Then cnd = True '<= thay doi gio cap nhat ( so 20 )
        'gio cap nhat nen lay sau 6g30 toi, khoang 6g45 tro di ( 19-20 )
    End If
End With
If cnd = True Then
    eNs = Array(5, 5, 5, 5, 4, 4, 3, 2)
    With http
        Do While cnd = True
            .Open "GET", "https://www.minhngoc.net.vn/ket-qua-xo-so/mien-bac/?ngay=" & Sheet1.Range("J3"), False
            .send
            Do While .readyState <> 4
                DoEvents
            Loop
            html.body.innerHTML = .responseText
            Set resT = html.getElementById("result_tab_mb")
            ReDim result(1 To 10, 1 To 7) As String
            If Not resT Is Nothing Then
                i = 1
                For Each resR In resT.Rows
                    If i <= 4 Then
                        j = 0
                        For Each cll In resR.Cells
                            result(i, j + 1) = cll.innerText
                            j = j + 1
                        Next cll
                    Else
                        If i <= 10 Then
                            j = 0
                            For Each cll In resR.Cells
                                t = cll.innerText
                                If j = 0 Then
                                    result(i, 1) = t
                                Else
                                    k = Len(t) / eNs(i - 3)
                                    For z = 1 To k
                                        result(i, z + 1) = Mid(t, (z - 1) * eNs(i - 3) + 1, eNs(i - 3))
                                    Next z
                                    
                                End If
                                j = j + 1
                            Next cll
                        Else
                            Exit For
                        End If
                    End If
                    i = i + 1
                Next resR
            
                With Sheet1
                    If Len(hd) > 0 Then
                        .Range("A" & Rows.Count).End(xlUp).Clear
                        hd = ""
                    End If
                    .Range("A" & Rows.Count).End(xlUp).Offset(1).Resize(10, 7).NumberFormat = "@"
                    .Range("A" & Rows.Count).End(xlUp).Offset(1).Resize(10, 7) = result
                    .Range("A" & Rows.Count).End(xlUp).Offset(-9).Resize(10, 7).WrapText = 0
                    .Range("A" & Rows.Count).End(xlUp).Select
                End With
                DoEvents
            Else
                If Len(hd) = 0 Then
                    rws = Sheet1.Range("A" & Rows.Count).End(xlUp).row + 1
                Else
                    rws = Sheet1.Range("A" & Rows.Count).End(xlUp).row
                End If
                hd = Sheet1.Range("A" & rws) & " " & Sheet1.Range("J3")
                Sheet1.Range("A" & rws) = hd
            End If
            Application.Volatile
            With Sheet1
                If .Range("J2") = .Range("J1") And .Range("I1") < 19 Then cnd = False
                If .Range("J2") > .Range("J1") Then cnd = False
            End With
        Loop
    End With
End If
Sheet1.Activate
Sheet1.Range("A1").Select
End Sub