PDA

View Full Version : Solved: msg box



Ger
02-29-2008, 06:03 AM
Hi,

I want a msg box displayed if the value of 2 cells is not equal.
I know i must put the macro in the worksheet with the option change.
the cells are GE141 and GE142.
I think it looks like:

Private Sub Worksheet_Change(ByVal Target As Range)
If Then
MsgBox "deze invoer is onjuist"
End If
End Sub

Ger:help

Bob Phillips
02-29-2008, 06:53 AM
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Me.Range("GE141:GE142")) Is Nothing Then
If Me.Range("GE141").Value <> Me.Range("GE142").value Then
MsgBox "deze invoer is onjuist"
End If
End If
End Sub

Ger
03-05-2008, 01:07 AM
I've got it simple:

Private Sub Worksheet_Change(ByVal Target As Range)

If [ge119] <> [ge120] Then
msgbox "deze invoer is onjuist"
End If

End Sub


This works fine.

Ger