ericsilvapereira Posted August 29, 2011 Report Share Posted August 29, 2011 Sub Geral()Sheets("Boletim de Ocorrência").SelectIf H30 <= 11 Then Sheets("Estatística").Select Range("BA5:BH5").Select Selection.ClearContents Range("BA5").Select ActiveCell.FormulaR1C1 = "X"If 12 >= H30 <= 17 Then Sheets("Estatística").Select Range("BA5:BH5").Select Selection.ClearContents Range("BB5").Select ActiveCell.FormulaR1C1 = "X"If 18 >= H30 <= 24 Then Sheets("Estatística").Select Range("BA5:BH5").Select Selection.ClearContents Range("BC5").Select ActiveCell.FormulaR1C1 = "X"If 25 >= H30 <= 29 Then Sheets("Estatística").Select Range("BA5:BH5").Select Selection.ClearContents Range("BD5").Select ActiveCell.FormulaR1C1 = "X"If 30 >= H30 <= 34 Then Sheets("Estatística").Select Range("BA5:BH5").Select Selection.ClearContents Range("BE5").Select ActiveCell.FormulaR1C1 = "X"If 35 >= H30 <= 64 Then Sheets("Estatística").Select Range("BA5:BH5").Select Selection.ClearContents Range("BB5").Select ActiveCell.FormulaR1C1 = "X"If H30 >= 65 Then Sheets("Estatística").Select Range("BA5:BH5").Select Selection.ClearContents Range("BB5").Select ActiveCell.FormulaR1C1 = "X"Else Sheets("Estatística").Select Range("BA5:BH5").Select Selection.ClearContents Range("BH5").Select ActiveCell.FormulaR1C1 = "X"End IfEnd IfEnd IfEnd IfEnd IfEnd IfEnd IfEnd Sub Quote Link to comment Share on other sites More sharing options...
Question
ericsilvapereira
Sub Geral()
Sheets("Boletim de Ocorrência").Select
If H30 <= 11 Then
Sheets("Estatística").Select
Range("BA5:BH5").Select
Selection.ClearContents
Range("BA5").Select
ActiveCell.FormulaR1C1 = "X"
If 12 >= H30 <= 17 Then
Sheets("Estatística").Select
Range("BA5:BH5").Select
Selection.ClearContents
Range("BB5").Select
ActiveCell.FormulaR1C1 = "X"
If 18 >= H30 <= 24 Then
Sheets("Estatística").Select
Range("BA5:BH5").Select
Selection.ClearContents
Range("BC5").Select
ActiveCell.FormulaR1C1 = "X"
If 25 >= H30 <= 29 Then
Sheets("Estatística").Select
Range("BA5:BH5").Select
Selection.ClearContents
Range("BD5").Select
ActiveCell.FormulaR1C1 = "X"
If 30 >= H30 <= 34 Then
Sheets("Estatística").Select
Range("BA5:BH5").Select
Selection.ClearContents
Range("BE5").Select
ActiveCell.FormulaR1C1 = "X"
If 35 >= H30 <= 64 Then
Sheets("Estatística").Select
Range("BA5:BH5").Select
Selection.ClearContents
Range("BB5").Select
ActiveCell.FormulaR1C1 = "X"
If H30 >= 65 Then
Sheets("Estatística").Select
Range("BA5:BH5").Select
Selection.ClearContents
Range("BB5").Select
ActiveCell.FormulaR1C1 = "X"
Else
Sheets("Estatística").Select
Range("BA5:BH5").Select
Selection.ClearContents
Range("BH5").Select
ActiveCell.FormulaR1C1 = "X"
End If
End If
End If
End If
End If
End If
End If
End Sub
Link to comment
Share on other sites
0 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.