+ Reply to Thread
Results 1 to 8 of 8

Macro for Conditional formatting controlled by buttons

  1. #1
    Registered User
    Join Date
    11-06-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2003
    Posts
    32

    Macro for Conditional formatting controlled by buttons

    Hi,

    What I'm after is a code that does the following.

    On press:

    Range(H6:AK205)

    Cells with the value "C" turn green
    Cells with the value "X" turn orange
    Cells with the value "Y" turn Yellow

    Then another button to clear all and apply grey to cells with a value "R".

    Can anyone point me in the right direction?

    Thanks in advance!

    Rob.

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Macro for Conditional formatting controlled by buttons

    Try the below code to check cell value and apply the colors to the cells.

    Please Login or Register  to view this content.
    Try the below code to clear the cell value and reset it to R by applying the default formatting

    Please Login or Register  to view this content.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    11-06-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2003
    Posts
    32

    Re: Macro for Conditional formatting controlled by buttons

    Hi Sixthsense!

    Fantastic bit of code! The first part works like a charm!

    Although the reset function is not exactly, what I'm after.

    I need the reset function to remove all colour, yet still maintaining the integrity of the information within AND if possible, changing the cells that are already designated as "R" to say a light grey.

    Sorry for the confusion! Love your work so far though!

    Rob.
    Last edited by Rob.Marchel; 11-23-2013 at 01:08 AM.

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Macro for Conditional formatting controlled by buttons

    Try this...

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    11-06-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2003
    Posts
    32

    Re: Macro for Conditional formatting controlled by buttons

    Doesn't work, however, I've just removed the ".value = "R"" and it resets the range colour. This is actually probably better then what I wanted it to originally do.

    I really appreciate the help!

    Cheers,

    Rob.

  6. #6
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Macro for Conditional formatting controlled by buttons

    Delete all the CF for that range.

  7. #7
    Registered User
    Join Date
    11-06-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2003
    Posts
    32

    Re: Macro for Conditional formatting controlled by buttons

    How do you mean?

    I assumed that by removing .value, it would reset the colour, essentially deleting all the CF applied by the first code?

  8. #8
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Macro for Conditional formatting controlled by buttons

    For your info I have not used any CF in my code.

+ 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: 02-26-2013, 08:33 PM
  2. conditional formatting & radio buttons
    By JChandler22 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-25-2008, 10:19 AM
  3. controlled cell formatting
    By TonyG001 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-26-2008, 01:44 AM
  4. Text controlled conditional summing
    By chrisd in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-05-2008, 04:55 PM
  5. [SOLVED] VBA controlled conditional format
    By Paul in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-30-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