+ Reply to Thread
Results 1 to 4 of 4

To clear content if conditional formatting cell return gray color

  1. #1
    Registered User
    Join Date
    02-17-2013
    Location
    Bangkok
    MS-Off Ver
    Excel 2007
    Posts
    2

    To clear content if conditional formatting cell return gray color

    Dear Excel-ers,

    I am new to this forum and new for Excel macros, so I hope someone can advise me!

    I try to write macro that will clear content of the cell that conditional formatting return it back ground color as gray,
    Since the conditional formatting is very complicate & different throughout the cell, thus final result (background color is needed as reference to further macro process)

    In this case, in cell 3,3 value 22 should be deleted.

    However, I use record macro to copy the code, then use them as reference however it don't seem to work at all. Please see my code below & attachment at the bottom.

    Please Login or Register  to view this content.


    Any suggestions would be greatly appreciated. Many Big thanks for reading and do let me know if any further information is required.
    Attached Files Attached Files

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: To clear content if conditional formatting cell return gray color

    Hi,

    If it were me I'd avoid the technique you are using. It always seems risky to me to rely on colours and particularly shades when you need to perform actions.

    Are you sure standard conditional formatting won't give you what you want. If not then consider some other way of flagging what the colour of a cell is in another cell at the time you format the cells in question with some definitive label like a value or text. Then you can easily test for that label in any macro you want to use.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    02-17-2013
    Location
    Bangkok
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: To clear content if conditional formatting cell return gray color

    Thank you very much for you replay,

    I try to look in the formula as you suggest, however the formula for conditional formatting is very complicate and it is different between the cell (I get the file from previous colleague), however he confirm that the conditional color is final result, thus, to avoid changing his formula, I would like to just add on to what he did.

    Thus, I will be great if I can refer to these conditional color.

    Many thanks! :D

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: To clear content if conditional formatting cell return gray color

    Hi,

    Formulae in conditional formatting are no different to cell formulae so I'm somewhat surprised that you think they are 'very complicated'.

    I still maintain that you are using a sledgehammer to crack the proverbial nut and overcomplicating this unnecessarily. Upload your workbook so that we can see your request in context. Add some manually calculated results and formats explaining which ones they are and the rule you've applied to arrive at them.

+ 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