Hi Raushan,
I'm not completely positive I understand the logic of your worksheet - so pardon some of the vagueness in my answer. However, I believe that this will get you started in the right direction.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Value = "" And (Sheet1.Cells(Target.Row, 1) = "2" Or Sheet1.Cells _
(Target.Row, 1) = "3" Or Sheet1.Cells(Target.Row, 1) = "4") Then
Dim DateInCell As Date
Dim YearInCell As Integer
DateInCell = Sheet1.Cells(Target.Row, 2)
YearInCell = Year(DateInCell) 'Grab just the year from the date.
If YearInCell = CInt(2007) Then
Dim valueInLevel2 As Integer
valueInLevel2 = CInt(Sheet1.Cells(11, 8)) + CInt(Sheet1.Cells(12, 8)) _
+ CInt(Sheet1.Cells(13, 8)) + CInt(Sheet1.Cells(14, 8)) 'Add all lvl2 values
'Display Values with code
End If
End If
End Sub
This should get through your 'condition 1' - assuming I'm understanding your explanation of the condition correctly. You can reapply the logic of nesting the if..then.else statements to determine your other criteria.
Bookmarks