+ Reply to Thread
Results 1 to 6 of 6

Quick Access Macro to conditional format active cells

  1. #1
    Registered User
    Join Date
    04-18-2013
    Location
    Sweden
    MS-Off Ver
    Excel 2010
    Posts
    37

    Quick Access Macro to conditional format active cells

    Hi,

    I frequently use the following conditional formatting for a lot of my Excel files' cells:

    98,0% and below = Red fill
    Between 98,0% - 98,5% = Yellow fill
    98,5% and above = Green fill

    However, it costs me a lot of time doing this manually many times per day. It would be really beneficial to have a Quick Access macro in which I can highlight all the cells I want formatted, and simply press the button to do the formatting for me.

    Does anyone know how this VBA code would look? I know how to add the button to the toolbar, but am at a complete lost code-wise.

    Many thanks for any help on this one!

  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: Quick Access Macro to conditional format active cells

    Here is the recorded macro

    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
    04-18-2013
    Location
    Sweden
    MS-Off Ver
    Excel 2010
    Posts
    37

    Re: Quick Access Macro to conditional format active cells

    Hi Sixthsense,

    Thanks for the prompt response. The code looks great and I've added it to my file, however all values come up as Red, no matter what it is. I've tried changing the cell formatting (from general to percentage), the number, and nothing so far is resolving the issue. Do you have an idea why this could be?

  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: Quick Access Macro to conditional format active cells

    Try this...

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    04-18-2013
    Location
    Sweden
    MS-Off Ver
    Excel 2010
    Posts
    37

    Re: Quick Access Macro to conditional format active cells

    It seems the same issue is coming up - when I fire the macro, all activated cells just turn red no matter the value.

    Would it be possible to send me a file with an example of this code working? If so, I really appreciate it!

  6. #6
    Registered User
    Join Date
    04-18-2013
    Location
    Sweden
    MS-Off Ver
    Excel 2010
    Posts
    37

    Re: Quick Access Macro to conditional format active cells

    Hi Again,

    I've been messing around with the code a bit and got it to work. I changed it so that it doesn't have to have to be a percentage per se.

    I have one further issue however. If I highlight a range of cells, some of which do not meet the conditions of the code, all the formatting erases on the ones that are not relevant. How to I get the code to only erase & reformat the cells that meet the conditions?

    My current code for reference:

    Please Login or Register  to view this content.

+ 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. How to change help text associated with a macro button on Quick Access Toolbar?
    By XmisterIS in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-25-2014, 06:49 AM
  2. Conditional Format a range of cells if active cell is not in the range to be formatted.
    By anrichards22 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-07-2013, 05:49 AM
  3. [SOLVED] Macro - Format as Table selection active cells
    By Camardelli in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-14-2013, 12:10 PM
  4. Apply Conditional format only when cells are active?
    By bob63el in forum Excel General
    Replies: 3
    Last Post: 04-03-2013, 10:18 PM
  5. problems assigning a macro to a button in the quick access bar
    By yossie in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-17-2011, 05:29 AM

Tags for this Thread

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