+ Reply to Thread
Results 1 to 3 of 3

how to sense -1 value at any cell in a column

  1. #1
    Registered User
    Join Date
    11-12-2005
    Posts
    55

    Arrow how to sense -1 value at any cell in a column

    hi guys
    i have a column like that
    a

    1
    22
    341
    42
    5
    and each time i add more number to it
    how to sense after i type the number is it -1 or not??
    i mean if i write -1 and then i press enter or change the active cell ,if there is a way to check what i just wrote and see if it -1 or not??

  2. #2
    And1
    Guest

    Re: how to sense -1 value at any cell in a column

    If you write down in column A, try this:

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Application.Intersect(Columns("A:A"), Target) Is Nothing Then
    If Target.Value <> -1 Then
    MsgBox "there is <> -1"
    Else
    MsgBox "there is = -1"
    End If
    End If
    End Sub

    Kind Regards,
    Andrzej

    amrezzat napisał(a):
    > hi guys
    > i have a column like that
    > a
    >
    > 1
    > 22
    > 341
    > 42
    > 5
    > and each time i add more number to it
    > how to sense after i type the number is it -1 or not??
    > i mean if i write -1 and then i press enter or change the active cell
    > ,if there is a way to check what i just wrote and see if it -1 or not??
    >
    >


  3. #3
    Don Guillett
    Guest

    Re: how to sense -1 value at any cell in a column

    right click sheet tab>view code>insert this

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Column <> 1 Then Exit Sub
    If Target < 1 Then MsgBox "less than one"
    End Sub

    --
    Don Guillett
    SalesAid Software
    [email protected]
    "amrezzat" <[email protected]> wrote in
    message news:[email protected]...
    >
    > hi guys
    > i have a column like that
    > a
    >
    > 1
    > 22
    > 341
    > 42
    > 5
    > and each time i add more number to it
    > how to sense after i type the number is it -1 or not??
    > i mean if i write -1 and then i press enter or change the active cell
    > ,if there is a way to check what i just wrote and see if it -1 or not??
    >
    >
    > --
    > amrezzat
    > ------------------------------------------------------------------------
    > amrezzat's Profile:
    > http://www.excelforum.com/member.php...o&userid=28766
    > View this thread: http://www.excelforum.com/showthread...hreadid=539573
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1