Results 1 to 9 of 9

Excel VBA event handling

Threaded View

  1. #1
    Registered User
    Join Date
    04-04-2013
    Location
    Maplewood, MN
    MS-Off Ver
    Excel 2010
    Posts
    14

    Excel VBA event handling

    This is my code on vba for a excel sheet:
    Private Sub Worksheet_Change(ByVal Target As Range)
        If Target.Value < "0" Then
        MsgBox ("testing")
        End If
    End Sub
    It works but only when I manually click on a cell and change a value to negative. What I want is whenever any value on any sheet gets decremented to a negative number it pops up a msg warning me that a cell value is < 0. For example, if I request for 10 items in my inventory and I only have 9 quantity, the quantity which =sum(quantity - request) becomes negative and a popup msg will appear. The code up there doesn't really work, anyone know a way around this?
    Last edited by Leith Ross; 04-04-2013 at 11:13 PM. Reason: Added Code Tags

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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