HI
I have 2 sets of data I2:I13 and J2:J13
What I want to do is compare the cells and if the cell in I2 is > J2 then a message.
This would be relative ie would compare all cells - I3>J3 ect
This is what I have
Private Sub Worksheet_Change(ByVal Target As Range)
If Range("I2") > Range("j2") Then
MsgBox "Resource needed exceeds resource available "
End If
If Range("I3") > Range("j3") Then
'MsgBox "Resource needed exceeds resource available "
End If
End Sub
Which works ok but would mean that I will have to write code for each cell.
Must be an easer way!!
Any help would be apriciated
I have 2 sets of data I2:I13 and J2:J13
What I want to do is compare the cells and if the cell in I2 is > J2 then a message.
This would be relative ie would compare all cells - I3>J3 ect
This is what I have
Private Sub Worksheet_Change(ByVal Target As Range)
If Range("I2") > Range("j2") Then
MsgBox "Resource needed exceeds resource available "
End If
If Range("I3") > Range("j3") Then
'MsgBox "Resource needed exceeds resource available "
End If
End Sub
Which works ok but would mean that I will have to write code for each cell.
Must be an easer way!!
Any help would be apriciated