+ Reply to Thread
Results 1 to 4 of 4

Slow VBA code: Protecting cells based on colors while changing colors based on cell change

  1. #1
    Registered User
    Join Date
    02-24-2012
    Location
    NYC
    MS-Off Ver
    Excel 2010
    Posts
    2

    Slow VBA code: Protecting cells based on colors while changing colors based on cell change

    Hello! Have been reading these forums for weeks while doing some work and the helpfulness is really endless! I have found helpful bits of code that works really really well, but it's very slow! It seems like it needs to execute after EVERY change to the worksheet in order to work.

    This code, firstly, protects the worksheet and locks those cells that are color-coded other than green and yellow.

    Then, it checks if there is a change to the cell and if there is a change to a cell it recolors the cell as yellow.

    It runs very fast in a small worksheet with no data, but once I use the full Worksheet with 5 color-codes and up to 2000 rows it becomes very slow.

    Is there a faster solution, like if I limited the working range of the sheet? I really only need to protect BM2:DC2000, not the whole thing.

    Thank you for any ideas.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Slow VBA code: Protecting cells based on colors while changing colors based on cell ch

    Add...
    Please Login or Register  to view this content.
    After your sub title
    and
    Please Login or Register  to view this content.
    Before End Sub
    See if that helps.
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

  3. #3
    Registered User
    Join Date
    02-24-2012
    Location
    NYC
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Slow VBA code: Protecting cells based on colors while changing colors based on cell ch

    That did it! Thank you so much. I know I probably should have read a FAQ about this out there somewhere on optimizing your code, appreciate it tons!

  4. #4
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Slow VBA code: Protecting cells based on colors while changing colors based on cell ch

    No problem, glad it worked out for you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Change multiple cell colors based on date and time passed
    By cvalentine02 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-12-2013, 12:20 PM
  2. Replies: 2
    Last Post: 01-27-2012, 09:40 PM
  3. Changing colors of cells based on other cells
    By Squatty in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-17-2011, 03:09 PM
  4. Changing Cell Colors Based on Other Cell Values
    By Vinx in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-10-2010, 07:10 PM
  5. Change Cell Fill Color Based on Colors in 2 Columns
    By djkante in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-05-2010, 08:07 PM
  6. Replies: 2
    Last Post: 08-01-2007, 07:00 PM
  7. [SOLVED] Can an excel cell automatically change fill colors based on values
    By John Clark in forum Excel General
    Replies: 1
    Last Post: 02-05-2005, 02:06 PM
  8. Is it possible to change colors of cells based on value in cell (.
    By LC in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-14-2005, 02:06 AM

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