I have some basic knowledge and came up with a if else statement for 1 condition.. but unsure of what to do with 2 conditions.
so, If Column A says Employee, then do below.
But now, I need another condition, where if Column A says Dept, do another set of code similar to above.
In Column B, I have # of days, and I am wanting to have the result appear in Column C in the row next to each one, I'm able to get the result if I set range to only B2 and C2, however, it causes a bug when I try to do the range of B2:B11, for example.
What I would like to is for the code to loop for all cells in column B that are not NULL. I'm unsure of the syntax to use for that. appreciate your help in advance. and thank you
so, If Column A says Employee, then do below.
Code:
Sub Employee()
Dim Days As Integer
Dim result As String
Days = Range("B2:B11").Value
If Days >= 41 Then
result = "41"
ElseIf Days >= 36 Then
result = "36-40"
ElseIf Days >= 26 Then
result = "26-35"
ElseIf Days >= 0 Then
result = "0-25"
Else
result = "Future Dates"
End If
Range("C2:C11").Value = result
End Sub
But now, I need another condition, where if Column A says Dept, do another set of code similar to above.
In Column B, I have # of days, and I am wanting to have the result appear in Column C in the row next to each one, I'm able to get the result if I set range to only B2 and C2, however, it causes a bug when I try to do the range of B2:B11, for example.
What I would like to is for the code to loop for all cells in column B that are not NULL. I'm unsure of the syntax to use for that. appreciate your help in advance. and thank you