I3atnumb3rs
New Member
- Joined
- Nov 2, 2018
- Messages
- 34
Hello,
I'm trying to do a case statement in VBA. If the value in J is >= 200 AND <300 I want it to say in O REGULAR DELIVERY PV, when >= 300 AND <400 I want it to say REGULAR DELIVERY PV300, and when >= 400 REGULAR DELIVERY PV400. This does not work.
Sub VolumeChange()
'
Application.ScreenUpdating = False
'Changes delivery type
Dim x As Long
For x = 2 To Cells(Rows.Count, "J").End(xlUp).Row
Select Case UCase(Cells(x, 10))
Case Is >= 198
Cells(x, 15).FormulaR1C1 = "REGULAR DELIVERY PV"
Case Is >= 300
Cells(x, 15).FormulaR1C1 = "REGULAR DELIVERY PV300"
Case Is >= 400
Cells(x, 15).FormulaR1C1 = "REGULAR DELIVERY PV400"
End Select
Next x
End Sub
I'm trying to do a case statement in VBA. If the value in J is >= 200 AND <300 I want it to say in O REGULAR DELIVERY PV, when >= 300 AND <400 I want it to say REGULAR DELIVERY PV300, and when >= 400 REGULAR DELIVERY PV400. This does not work.
Sub VolumeChange()
'
Application.ScreenUpdating = False
'Changes delivery type
Dim x As Long
For x = 2 To Cells(Rows.Count, "J").End(xlUp).Row
Select Case UCase(Cells(x, 10))
Case Is >= 198
Cells(x, 15).FormulaR1C1 = "REGULAR DELIVERY PV"
Case Is >= 300
Cells(x, 15).FormulaR1C1 = "REGULAR DELIVERY PV300"
Case Is >= 400
Cells(x, 15).FormulaR1C1 = "REGULAR DELIVERY PV400"
End Select
Next x
End Sub