+ Reply to Thread
Results 1 to 5 of 5

Trying to understand Worksheet_Change event.

  1. #1
    Registered User
    Join Date
    11-24-2007
    Location
    Florida
    MS-Off Ver
    Various
    Posts
    64

    Trying to understand Worksheet_Change event.

    I am trying to figure out why this code won't work.

    It seems to do nothing at all.

    Please Login or Register  to view this content.
    I just want to understand how to build a code that updates data in a worksheet when any of the current data changes.

    For example, If someone puts the letter "x" in say... Cell F4, then Cell E39's value should change to "x"


    Any Help Appreciated.

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    As it stands, it seems to work. If I put a value into a cell, then it is immediately replaced with blah.

    I'd change the code slightly. Whenever you turn off events, you want to make sure they are turned on again if there is an error.

    rylo

    Please Login or Register  to view this content.

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Why not use formulas?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Registered User
    Join Date
    11-24-2007
    Location
    Florida
    MS-Off Ver
    Various
    Posts
    64
    Quote Originally Posted by royUK
    Why not use formulas?
    We are using formulas curently.

    The problem we have run into is that we can't manually overide data that is placed into cells with formulas in them without destroying the formula.

    The worksheet loads data from an external database. All of the worksheets reference this data in some way. We cannot edit the database, so if someone enters erroneous data into the database, then we cannot fix it on the spreadsheet without overiding the formula. So I am starting to look into vba as an alternative to solve our little dilemma

    Quote Originally Posted by rylo
    As it stands, it seems to work. If I put a value into a cell, then it is immediately replaced with blah.
    Yes it is working for me now. I must have somehow initially turned off events while I was noobishly playing around with code. Thanks for the info

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    If the data input is incorrect you will get an error whether with code or formula, correcting the error should be no more difficult with a formula.

+ 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