Thread: If Condition
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Claus Busch Claus Busch is offline
external usenet poster
 
Posts: 3,872
Default If Condition

Hi,

Am Tue, 25 Feb 2014 20:43:21 -0800 (PST) schrieb :

1 A B C D E
2 Name Grade Fee1 Fee2 Fee3
3 James I 1000 1500 2000
4 Peter II 1500 2000 2500
5 Kate III 2000 2500 3000


another suggestion:

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("B:B")) Is Nothing Or _
Target.Count 1 Then Exit Sub

Dim valStart As Double

Select Case Target
Case "I"
valStart = 1000
Case "II"
valStart = 1500
Case "III"
valStart = 2000
End Select
Target.Offset(, 1) = valStart
Target.Offset(, 2) = valStart + 500
Target.Offset(, 3) = valStart + 1000

End Sub


Regards
Claus B.
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2