• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Message Popup

Titu Sasi

New Member
Hi ,

I am trying to get a message popup if we subtract 2 numbers and the value is less than zero using data validation.
 

rahulshewale1

Active Member
HI @Titu Sasi,

See if is it ok ?
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A1:C1")) Is Nothing Then
    If Range("C1") < 0 Then
    MsgBox "CHECK!!!!"
End If
End If
End Sub
Regard
Rahul Shewale
 

Attachments

rahulshewale1

Active Member
hi @Titu Sasi,


See if is it ok ?

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A1:C100")) Is Nothing Then
    If Range("C" & Target.Row) < 0 Then
    MsgBox "CHECK!!!!"
    Range("C" & Target.Row).Select
End If
End If
End Sub
 

rahulshewale1

Active Member
Hi @Titu Sasi ,

See if is it ok ?

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("D5:F100")) Is Nothing Then
    If Range("F" & Target.Row) < 0 Then
    MsgBox "CHECK!!!!"
    Range("F" & Target.Row).Select
    End If
    Exit Sub
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
ElseIf Not Intersect(Target, Range("I5:N100")) Is Nothing Then
    
    If Range("N" & Target.Row) < 0 Then
        MsgBox "CHECK!!!!"
        Range("N" & Target.Row).Select
    End If
    Exit Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
ElseIf Not Intersect(Target, Range("T5:V100")) Is Nothing Then
 
    If Range("V" & Target.Row) < 0 Then
        MsgBox "CHECK!!!!"
        Range("V" & Target.Row).Select
    End If
    Exit Sub
End If
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
End Sub
 
Top