Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub SetGrade2()
- Dim AMenor As Integer
- Dim AMaior As Integer
- Dim BMenor As Integer
- Dim BMaior As Integer
- Dim FMenor As Integer
- Dim FMaior As Integer
- AMenor = Cells(2, 11).Value
- AMaior = Cells(2, 12).Value
- BMenor = Cells(3, 11).Value
- BMaior = Cells(3, 12).Value
- FMenor = Cells(4, 11).Value
- FMaior = Cells(4, 12).Value
- Do While ActiveCell.Value <> ""
- If ActiveCell.Value <> "" Then
- ActiveCell.Offset(1, 0).Select
- End If
- If ActiveCell.Value >= AMenor And ActiveCell.Value <= AMaior Then
- ActiveCell(1, 2).Value = "A"
- ActiveCell(1, 2).Interior.ColorIndex = 4
- ActiveCell(1, 2).HorizontalAlignment = xlCenter
- ActiveCell(1, 2).VerticalAlignment = xlCenter
- ElseIf ActiveCell.Value >= BMenor And ActiveCell.Value <= BMaior Then
- ActiveCell(1, 2).Value = "B"
- ActiveCell(1, 2).Interior.ColorIndex = 44
- ActiveCell(1, 2).HorizontalAlignment = xlCenter
- ActiveCell(1, 2).VerticalAlignment = xlCenter
- ElseIf ActiveCell.Value >= FMenor And ActiveCell.Value <= BMaior Then
- ActiveCell(1, 2).Value = "F"
- ActiveCell(1, 2).Interior.Color = RGB(255, 0, 0)
- ActiveCell(1, 2).HorizontalAlignment = xlCenter
- ActiveCell(1, 2).VerticalAlignment = xlCenter
- ActiveCell(1, 1).Interior.Color = RGB(255, 0, 0)
- ActiveCell(1, 0).Interior.Color = RGB(255, 0, 0)
- End If
- Loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement