Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

Sub Chagas()

Dim n As Long

n = 500000

For i = 3 To n

b=0

a=i

If Cells(i, "F") = "true" Then

For j = 1 To 12

Cells(a, "H") = Cells(a, "D")

Cells(a, "I") = Cells(a, "A")

Cells(a, "J") = Cells(a, "B")

b = b + Cells(a, "D")

If j = 3 Then

Cells(a, "K") = b

ElseIf j = 6 Then

Cells(a, "L") = b

ElseIf j = 9 Then

Cells(a, "M") = b

ElseIf j = 12 Then

Cells(a, "N") = b

End If

a=a+1

Next j

End If

Next i
End Sub

Sub Amorim()

Dim n As Long

n = 500000

For i = 3 To n

b=0

a=i

If Cells(i, "F") = "true" Then

For j = 1 To 15

Cells(a, "H") = Cells(a, "D")

Cells(a, "I") = Cells(a, "A")

Cells(a, "J") = Cells(a, "B")

b = b + Cells(a, "D")

If j = 3 Then

Cells(a, "K") = b

ElseIf j = 6 Then

Cells(a, "L") = b

ElseIf j = 9 Then

Cells(a, "M") = b

ElseIf j = 12 Then

Cells(a, "N") = b

ElseIf j = 15 Then

Cells(a, "O") = b

End If

a=a+1
Next j

End If

Next i

End Sub
Sub Chagas()

Dim n As Long

n = 1040000

For i = 3 To n

b=0

a=i

If Cells(i, "F") = "true" Then

For j = 1 To 24

Cells(a, "H") = Cells(a, "D")

Cells(a, "I") = Cells(a, "A")

Cells(a, "J") = Cells(a, "B")

b = b + Cells(a, "D")

If j = 15 Then

Cells(a, "K") = b

ElseIf j = 21 Then

Cells(a, "L") = b

ElseIf j = 24 Then

Cells(a, "M") = b

End If

a=a+1

Next j

End If

Next i
End Sub

IF(B3<>B2,”true”,”false”)

You might also like