Bạn nên đưa vô mảng để xử lí' Như vậy sẽ cải thiện được tình hình.
em chưa biết cách đưa vào mảng. Mong anh chỉ giúp


Private Sub CommandButton2_Click()
Dim rc As Long, m As Integer, i As Integer, Rn As Integer, k As Integer, n As Integer, t As Integer
Dim rc1 As Integer, ii As Integer, ik As Integer, boiso1 As Integer, boiso2 As Integer, boisoc As Integer, boisot As Integer
Dim mm As Integer, ranget As Range, rangec As Range, Rng As Range
Dim irow As Integer, n1 As Integer, n2 As Integer, n3 As Integer, n4 As Integer
rc = S01.Cells(Cells.Rows.Count, 1).End(xlUp).Row
For n = 1 To 100
For n1 = n + 1 To 100
For n2 = n1 + 1 To 100
For n3 = n2 + 1 To 100
For n4 = n3 + 1 To 100
S01.Range("A1:A1").ClearContents
ii = 0
For i = 2 To rc
S01.Cells(1, 1).Value = S01.Cells(i, n + 1).Value + S01.Cells(i, n1 + 1).Value + S01.Cells(i, n2 + 1).Value + S01.Cells(i, n3 + 1).Value + S01.Cells(i, n4 + 1).Value
If S01.Cells(1, 1).Value > 0 Then
ii = ii + 1
End If
Next i
If ii > 35 Then
S04.Activate
S04.Range("A65536").End(xlUp).Offset(1, 0).Select
irow = ActiveCell.Row
S04.Cells(irow, 1).Value = S01.Cells(1, n + 1).Value
S04.Cells(irow, 2).Value = S01.Cells(1, n1 + 1).Value
S04.Cells(irow, 3).Value = S01.Cells(1, n2 + 1).Value
S04.Cells(irow, 4).Value = S01.Cells(1, n3 + 1).Value
S04.Cells(irow, 5).Value = S01.Cells(1, n4 + 1).Value
End If
Next n4
Next n3
Next n2
Next n1
Next n
End Sub