Thread: If..statement
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Sandy Sandy is offline
external usenet poster
 
Posts: 156
Default If..statement

Try using a case statement:


Sub Test()
Select Case Range("A1").Value
Case 100 To 104
Range("B1").Value = 40
Case 105 To 109
Range("B1").Value = 44
Case 110 To 114
Range("B1").Value = 47
Case Is = 115
Range("B1").Value = 50
End Select
End Sub

Sandy
amatuer wrote:
Hi, could sumone pls help me with a nested if statement...
I want to assign a number to a cell depending on wat the contents of
another cell is.

eg: 100 - 104 assign 40
105-109 assign 44
110-114 assign 47
115+ assign 50

this is 1 if statement, id like to also add anothr nested if statement
to that same cell...

any suggestion? Thanx in advance