• 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.
 
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

  • Event Vba.xlsm
    18.4 KB · Views: 5
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
 
Hi @rahulshewale1

thanks for your prompt reply

I am attaching the sheet in which I am trying to upload these formulas , but its not working if trying to do the same in multiple cells
from d5 to f100 , l5 to n100 & t5 to v100

Please help ...
 

Attachments

  • Blank Utilization (2).zip
    597.5 KB · Views: 3
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
 
Back
Top