+ Reply to Thread
Results 1 to 9 of 9

Macro to run whenever any cell in the spreadsheet is modified

  1. #1
    Registered User
    Join Date
    11-20-2012
    Location
    kettering england
    MS-Off Ver
    Excel 2000
    Posts
    15

    Macro to run whenever any cell in the spreadsheet is modified

    I need to use a macro to apply colours to a cell based on the cell value and if that cell value is changed subsequently I want the macro to run again - is this possible, please?

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Macro to run whenever any cell in the spreadsheet is modified

    Sure - you can use the worksheet change event and color it by the cell's new value.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    11-20-2012
    Location
    kettering england
    MS-Off Ver
    Excel 2000
    Posts
    15

    Re: Macro to run whenever any cell in the spreadsheet is modified

    I am using Excel 2000 - does that have worksheet change event?

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Macro to run whenever any cell in the spreadsheet is modified

    Yes - bring up the code module for the worksheet where you want the code to run and choose worksheet from the leftmost drop down - it will bring up the selection change event - from the right most dropdown you can then choose the Worksheet_Change event - it will give you the code envelope and you're ready to start coding
    Target is automatically the cell selected ( a range).

  5. #5
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Macro to run whenever any cell in the spreadsheet is modified

    you can also use conditional formatting without any code subject to a 4 condition limit (3 for conditional formatting plus the default cell formatting)
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  6. #6
    Registered User
    Join Date
    11-20-2012
    Location
    kettering england
    MS-Off Ver
    Excel 2000
    Posts
    15

    Re: Macro to run whenever any cell in the spreadsheet is modified

    I found the code sheet but no dropdowns - I am Excel 2000

    Quote Originally Posted by xladept View Post
    Yes - bring up the code module for the worksheet where you want the code to run and choose worksheet from the leftmost drop down - it will bring up the selection change event - from the right most dropdown you can then choose the Worksheet_Change event - it will give you the code envelope and you're ready to start coding
    Target is automatically the cell selected ( a range).

  7. #7
    Registered User
    Join Date
    11-20-2012
    Location
    kettering england
    MS-Off Ver
    Excel 2000
    Posts
    15

    Re: Macro to run whenever any cell in the spreadsheet is modified

    I need 12 colours.....

    Quote Originally Posted by JosephP View Post
    you can also use conditional formatting without any code subject to a 4 condition limit (3 for conditional formatting plus the default cell formatting)

  8. #8
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Macro to run whenever any cell in the spreadsheet is modified

    in the vb editor you should see the attached. I've highlighted the dropdowns
    Attached Images Attached Images

  9. #9
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Macro to run whenever any cell in the spreadsheet is modified

    Maybe by using the terminology "leftmost" and "rightmost" I, inadvertently, mislead you as there are only two as shown by JosephP's pic of the envelope I described????

+ 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