+ Reply to Thread
Results 1 to 5 of 5

Macro to create new tabs based off of a type and apply conditional formatting

  1. #1
    Registered User
    Join Date
    05-16-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    12

    Macro to create new tabs based off of a type and apply conditional formatting

    I have a workbook with one tab and I am trying to figure out a macro that will do the following:

    1-Take the data in Sheet1 and have the data broken into tabs containing the respective candy
    -so a tab for bubble gum, candy bar, licorice, lollipop and stick candy
    2-In each tab, have conditional formatting based on value in the Quality column
    -red for a value between 0-25
    -pink for a value between 26-50
    -yellow for a value between 51-75
    -green for a value between 76-100

    For each tab, I still want each column that exists in Sheet1. I just want them broken out into new tabs.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Macro to create new tabs based off of a type and apply conditional formatting

    Bit more than I originally thought it would be:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    05-16-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Macro to create new tabs based off of a type and apply conditional formatting

    That worked, thank you. I will mark as complete, but I am curious as to how the code changes if instead of font color, its the cell color that changes?

  4. #4
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Macro to create new tabs based off of a type and apply conditional formatting

    font change the text color; interior changes the cell color

  5. #5
    Registered User
    Join Date
    05-16-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Macro to create new tabs based off of a type and apply conditional formatting

    Thank you, I have changed the macro to reflect the cell color to change and not the font. So now when I run the macro, the cell colors do change, but I think I a now missing something to tell the macro when to stop. For example, for lollipop including the title row, there are 25 rows, but the cells in C26 and onward show the color red.

    Do I need to include something like "Interior.ColorIndex = xlNone" for rows that have no data?

+ 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. Replies: 1
    Last Post: 05-28-2014, 06:31 PM
  2. [SOLVED] Add border & apply conditional formatting to sheets based on cell value
    By amar05 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-14-2013, 11:02 AM
  3. VBA for Conditional Formatting - apply a colour based on conditions in each column.
    By acsishere in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-27-2013, 01:24 PM
  4. HOW CAN I APPLY CONDITIONAL FORMATTING BASED TO AN ENTIRE ROW?
    By James M in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-19-2005, 11:45 AM
  5. Macro to apply several conditional formatting criteria
    By useR in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-04-2005, 12:05 PM

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