Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub Botão52_Click()
- Dim proteins As Integer
- Dim carbs As Integer
- Dim fat As Integer
- Dim cals As Integer
- Dim dia As Integer
- Dim mes As Integer
- Dim ano As Integer
- Dim x As Integer
- Dim y As Integer
- Dim Count As Integer
- proteins = carbs = fat = cals = 0
- Count = Application.CountA(Range("A:A"))
- For i = 4 To Count - 2
- If Cells(i, 2).Value = "" Then
- Else
- If Cells(i, 7).Value = True Then
- proteins = proteins + Cells(i, 2).Value
- carbs = carbs + Cells(i, 3).Value
- fat = fat + Cells(i, 4).Value
- cals = cals + Cells(i, 5).Value
- End If
- End If
- Next i
- Cells(4, 10).Value = proteins
- Cells(4, 11).Value = carbs
- Cells(4, 12).Value = fat
- Cells(4, 13).Value = cals
- For i = 0 To 3
- Select Case i
- Case 0
- x = 2
- y = 17
- Case 1
- x = 2
- y = 30
- Case 2
- x = 2
- y = 24
- Case 3
- x = 2
- y = 11
- Case Else
- End Select
- If Cells(4, 10 + i).Value < Worksheets("MacroNutrients").Range("B1:B30").Cells(y).Value Then
- Cells(6, 10 + i).Value = "-"
- Cells(6, 10 + i).Interior.ColorIndex = 3
- Cells(5, 10 + i).Value = Abs(Cells(4, 10 + i).Value - Worksheets("MacroNutrients").Range("B1:B30").Cells(y).Value)
- ElseIf Cells(4, 10).Value > Worksheets("MacroNutrients").Range("B1:B30").Cells(y).Value Then
- Cells(6, 10 + i).Value = "+"
- Cells(6, 10 + i).Interior.ColorIndex = 35
- Cells(5, 10 + i).Value = Cells(4, 10 + i).Value - Worksheets("MacroNutrients").Range("B1:B30").Cells(y).Value
- End If
- Next i
- dia = Day(Date)
- mes = Month(Date)
- ano = Year(Date)
- End Sub
- Sub Botão53_Click()
- Dim Count As Integer
- Count = Application.CountA(Range("A:A"))
- For i = 4 To Count + 2
- Range("G:G").Cells(i).Value = False
- Next i
- For i = 0 To 2
- Cells(4 + i, 10).Value = ""
- Cells(4 + i, 11).Value = ""
- Cells(4 + i, 12).Value = ""
- Cells(4 + i, 13).Value = ""
- Next i
- End Sub
Add Comment
Please, Sign In to add comment