+ Reply to Thread
Results 1 to 4 of 4

Restrict Data Entry, data validation

  1. #1
    Dan Connors
    Guest

    Restrict Data Entry, data validation

    I have a cell that is populated through a formula, I was hoping to have an
    error to display if the formula brings that cell below zero. I would also
    like to cancel the event that lead up to this error.

    Any ideas?

  2. #2
    Ardus Petus
    Guest

    Re: Restrict Data Entry, data validation

    Paste following code in worksheet's code
    (right-click on sheet tab, select Code)

    '--------------------------
    Private Sub Worksheet_Calculate()
    If Range("A1").Value < 0 Then
    MsgBox ("Below zero")
    Application.EnableEvents = False
    Application.Undo
    Application.EnableEvents = True
    End If
    End Sub
    '------------------------------------

    HTH
    --
    AP


    "Dan Connors" <[email protected]> a écrit dans le message
    de news:[email protected]...
    > I have a cell that is populated through a formula, I was hoping to have an
    > error to display if the formula brings that cell below zero. I would also
    > like to cancel the event that lead up to this error.
    >
    > Any ideas?




  3. #3
    Dan Connors
    Guest

    Re: Restrict Data Entry, data validation

    Fantastic! Thank you so much.

    "Ardus Petus" wrote:

    > Paste following code in worksheet's code
    > (right-click on sheet tab, select Code)
    >
    > '--------------------------
    > Private Sub Worksheet_Calculate()
    > If Range("A1").Value < 0 Then
    > MsgBox ("Below zero")
    > Application.EnableEvents = False
    > Application.Undo
    > Application.EnableEvents = True
    > End If
    > End Sub
    > '------------------------------------
    >
    > HTH
    > --
    > AP
    >
    >
    > "Dan Connors" <[email protected]> a écrit dans le message
    > de news:[email protected]...
    > > I have a cell that is populated through a formula, I was hoping to have an
    > > error to display if the formula brings that cell below zero. I would also
    > > like to cancel the event that lead up to this error.
    > >
    > > Any ideas?

    >
    >
    >


  4. #4
    Ardus Petus
    Guest

    Re: Restrict Data Entry, data validation

    Thanks for the feedback!
    --
    AP

    "Dan Connors" <[email protected]> a écrit dans le message
    de news:[email protected]...
    > Fantastic! Thank you so much.
    >
    > "Ardus Petus" wrote:
    >
    > > Paste following code in worksheet's code
    > > (right-click on sheet tab, select Code)
    > >
    > > '--------------------------
    > > Private Sub Worksheet_Calculate()
    > > If Range("A1").Value < 0 Then
    > > MsgBox ("Below zero")
    > > Application.EnableEvents = False
    > > Application.Undo
    > > Application.EnableEvents = True
    > > End If
    > > End Sub
    > > '------------------------------------
    > >
    > > HTH
    > > --
    > > AP
    > >
    > >
    > > "Dan Connors" <[email protected]> a écrit dans le

    message
    > > de news:[email protected]...
    > > > I have a cell that is populated through a formula, I was hoping to

    have an
    > > > error to display if the formula brings that cell below zero. I would

    also
    > > > like to cancel the event that lead up to this error.
    > > >
    > > > Any ideas?

    > >
    > >
    > >




+ 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