+ Reply to Thread
Results 1 to 1 of 1

Attach code to each sheet and if a new sheet is created add the code to this automatically

  1. #1
    Registered User
    Join Date
    03-14-2012
    Location
    Galway, Ireland
    MS-Off Ver
    Excel 2007
    Posts
    46

    Talking Attach code to each sheet and if a new sheet is created add the code to this automatically

    Hi i have attached a excel file.
    There is a button and when this button is pressed it creates a new sheet and some other stuff is done.
    On this new sheet you will see 4 Red Lines.
    For these red lines to change to xlNone The cell to there right with 0 in it must = up to 100.
    If it does not equal 100 then it will stay red.
    Now on the front page a new row is created you will see that the name of the row matched your new sheet.
    There will also be 3 cells which are red here these are directly linked with the new sheet and will change if the new sheet changes.
    My problem is that if you have created 2 new sheets and have not summed up the values correctly then in order to get rid of the red line you have to do it manually and i do not want this.
    I was wondering if there is a way to link the code with this sheet so if the sheet is modified then it checks to see if it equals 100 and if it does change the respective cells in the front page.
    I tired to add my code to the sheet but couldn't get it to work if you can add code this way to sheets and get it to run every time the sheets is modified that may work the best for this but i'm not sure.

    I am doing everything though VBA.
    This document is not fully functional as it is only a test doc for this question.
    Thank you.
    Attached Files Attached Files
    Last edited by Irish RayRay; 04-18-2012 at 11:38 AM.

+ 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