Thread: Calculation
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
JE McGimpsey JE McGimpsey is offline
external usenet poster
 
Posts: 4,624
Default Calculation

One way:

Dim rCell As Range
For Each rCell In Range("A1,A3")
With rCell
If .Value = 0 Then
Select Case .Offset(1, 0).Value
Case Is = 1.5
.Offset(0, 1).Value = "Good"
Case Is = 2.75
.Offset(0, 1).Value = "Excellent"
Case Is 2.75
.Offset(0, 1).Value = "Superb"
Case Else
.Offset(0, 1).ClearContents
End Select
End If
End With
Next rCell

In article ,
AlanW wrote:

Under the condition, if

A1=0 and A2 = 1-1/2, then B1 = Good
A1=0 and A2 = 2-3/4, then B1 = Excellent
A1=0 and A2 2-3/4, then B1 = Superb

A3=0 and A4 = 1-1/2, then B3 = Good
A3=0 and A4 = 2-3/4, then B3= Excellent
A3=0 and A4 2-3/4, then B3= Superb,
and so on€¦

I would like to do it by VBA, could someone please help.