+ Reply to Thread
Results 1 to 4 of 4

change event not recognized

  1. #1
    rebelxtuser
    Guest

    change event not recognized

    I am running Excel 2003 under Windows XP, and I want to do some data
    validation when a cell is changed in the worksheet. Using this example from
    Visual Basic Help:

    Private Sub Worksheet_Change(ByVal Target as Range)
    Target.Font.ColorIndex = 5
    End Sub

    this Sub is never executed when any cell in the worksheet is changed. I
    set a breakpoint in the sub, and it never triggered. Does the sub have to be
    in some particular module, or do events have to be activated in some manner?

  2. #2
    Bob Phillips
    Guest

    Re: change event not recognized

    Did you put it in the sheet code module, not a standard code module?

    --
    HTH

    Bob Phillips

    (replace somewhere in email address with gmail if mailing direct)

    "rebelxtuser" <[email protected]> wrote in message
    news:[email protected]...
    > I am running Excel 2003 under Windows XP, and I want to do some data
    > validation when a cell is changed in the worksheet. Using this example

    from
    > Visual Basic Help:
    >
    > Private Sub Worksheet_Change(ByVal Target as Range)
    > Target.Font.ColorIndex = 5
    > End Sub
    >
    > this Sub is never executed when any cell in the worksheet is changed. I
    > set a breakpoint in the sub, and it never triggered. Does the sub have to

    be
    > in some particular module, or do events have to be activated in some

    manner?



  3. #3
    Nick Hodge
    Guest

    Re: change event not recognized

    The procedure must be in the worksheet module who events you are monitoring.
    Right click the sheet tab and select 'view code'. It goes here

    --
    HTH
    Nick Hodge
    Microsoft MVP - Excel
    Southampton, England
    www.nickhodge.co.uk
    [email protected]HIS


    "rebelxtuser" <[email protected]> wrote in message
    news:[email protected]...
    >I am running Excel 2003 under Windows XP, and I want to do some data
    > validation when a cell is changed in the worksheet. Using this example
    > from
    > Visual Basic Help:
    >
    > Private Sub Worksheet_Change(ByVal Target as Range)
    > Target.Font.ColorIndex = 5
    > End Sub
    >
    > this Sub is never executed when any cell in the worksheet is changed. I
    > set a breakpoint in the sub, and it never triggered. Does the sub have to
    > be
    > in some particular module, or do events have to be activated in some
    > manner?




  4. #4
    Jim Thomlinson
    Guest

    RE: change event not recognized

    if your events have been disabled without being re-enabled then you will have
    to re-enable them. Run this one litle bit of code and then try your
    spreadsheet again

    Sub ResetEvents()
    application.enableevents = true
    end sub

    Whenever you are toggling application settings make sure that you reset them
    and that you have error handling to catch the inevitable error that will come
    up at some point in your life...
    --
    HTH...

    Jim Thomlinson


    "rebelxtuser" wrote:

    > I am running Excel 2003 under Windows XP, and I want to do some data
    > validation when a cell is changed in the worksheet. Using this example from
    > Visual Basic Help:
    >
    > Private Sub Worksheet_Change(ByVal Target as Range)
    > Target.Font.ColorIndex = 5
    > End Sub
    >
    > this Sub is never executed when any cell in the worksheet is changed. I
    > set a breakpoint in the sub, and it never triggered. Does the sub have to be
    > in some particular module, or do events have to be activated in some manner?


+ 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