Consulting

Results 1 to 3 of 3

Thread: Solved: msg box

  1. #1
    VBAX Contributor
    Joined
    Feb 2008
    Posts
    193
    Location

    Solved: msg box

    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

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    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
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Contributor
    Joined
    Feb 2008
    Posts
    193
    Location
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •