Hi there, I tried to make a nested if statement that recognizes an input box..
I am having some trouble with the next statement it seems.
Anyone that can find out the problem for this?
Sub CheckFrequency()
Dim input_box As Integer
input_box = InputBox("What should frequency be higher than?")
For m = 5 To 20
If input_box = "5" Then
If Range("F" & m).Value > 0 Then
Range("G" & m).Interior.ColorIndex = 7
ElseIf input_box = "4" Then
If Range("F" & m).Value > 0 Then
Range("G" & m).Interior.ColorIndex = 7
ElseIf input_box = "3" Then
If Range("E" & m).Value > 0 Or Range("F" & m).Value > 0 Then
Range("G" & m).Interior.ColorIndex = 7
ElseIf input_box = "2" Then
If Range("D" & m).Value > 0 Or Range("E" & m).Value > 0 Or Range("F" & m).Value > 0 Then
Range("G" & m).Interior.ColorIndex = 7
ElseIf input_box = "1" Then
If Range("C" & m).Value > 0 Or Range("D" & m).Value > 0 Or Range("E" & m).Value > 0 Or Range("F" & m).Value > 0 Then
Range("G" & m).Interior.ColorIndex = 7
End If
Next
End Sub
Bookmarks