View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_3_] Bob Phillips[_3_] is offline
external usenet poster
 
Posts: 2,420
Default Can I use Select Case to do this?

Select Case True

Case Range("C" & i).Value = MyVa And _
Range("D" & i).Value = "Ready to ship "
Range("E" & i).Value = "Right on time"

Case Range("C" & i).Value < MyVa And _
Range("D" & i).Value = "Ready to ship "
Range("E" & i).Value = "Missed Code Date"

Case Range("B" & i).Value = MyVa + 1 And _
Range("D" & i).Value = "Ready to ship"
Range("E" & i).Value = "One day early"

Case Range("B" & i).Value = MyVa + 2 And _
Range("D" & i).Value = "Ready to ship"
Range("E" & i).Value = "Two days early"

Case Range("B" & i).Value = MyVa And _
Range("D" & i).Value = "Outstanding work"
Range("E" & i).Value = "One day late"
End Select


--
__________________________________
HTH

Bob

"ChipButtyMan" wrote in message
...
Hi,
I guess it would be better to use Select Case statement to do this
but I don't know how I would write the code.
MyVa is a variable that contains an integer (that represents a
workday)
Thank you for your help, time & expertise.


If Range("C" & i).Value = MyVa And Range("D" & i).Value = "Ready to
ship" Then
Range("E" & i).Value = "Right on time"
End If

If Range("C" & i).Value < MyVa And Range("D" & i).Value = "Ready to
ship" Then
Range("E" & i).Value = "Missed Code Date"
End If

If Range("B" & i).Value = MyVa + 1 And Range("D" & i).Value =
"Ready to ship" Then
Range("E" & i).Value = "One day early"
End If

If Range("B" & i).Value = MyVa + 2 And Range("D" & i).Value =
"Ready to ship" Then
Range("E" & i).Value = "Two days early"
End If

If Range("B" & i).Value = MyVa And Range("D" & i).Value =
"Outstanding work" Then
Range("E" & i).Value = "One day late"
End If