+ Reply to Thread
Results 1 to 8 of 8

Macro to clear only the contents of the cells which have a specific font colour

  1. #1
    Registered User
    Join Date
    07-05-2013
    Location
    Greece
    MS-Off Ver
    Excel 2007
    Posts
    4

    Exclamation Macro to clear only the contents of the cells which have a specific font colour

    Cells B2 to B1577 have contents in black and also in colour with RGBs red 51, green 51 and blue 153, and i want to keep only contents in black
    can you please help me?

    thank you in advance

  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: Macro to clear only the contents of the cells which have a specific font colour

    Hi and welcome to the forum.

    The most efficient way would be to filter the list and then clear the contents. However there's no standard non VBA functionality that will filter by colour so the first question to ask is is there any other column which could be used for the filter. i.e. where there is a direct correlation between the value in the column and the colour in column B
    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
    07-05-2013
    Location
    Greece
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Macro to clear only the contents of the cells which have a specific font colour

    unfortunately both colours exists in every cell, see bellow how it is:
    i.e.

    COCA-COLA
    (MANAGING DIRECTOR)

    How can I delete the black font content from the cell and leave only the blue one?

  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: Macro to clear only the contents of the cells which have a specific font colour

    Quote Originally Posted by Stellakyp View Post
    unfortunately both colours exists in every cell, see bellow how it is:
    i.e.

    COCA-COLA
    (MANAGING DIRECTOR)

    How can I delete the black font content from the cell and leave only the blue one?
    Were you intending to upload a workbook so that we can see the request in context. I don;t understand your statement that both colours exist in every cell. A cell can only have one background colour and one font colour, (leaving aside the special shading formats).

  5. #5
    Registered User
    Join Date
    07-05-2013
    Location
    Greece
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Macro to clear only the contents of the cells which have a specific font colour

    see attached sample column A
    Attached Files Attached Files

  6. #6
    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: Macro to clear only the contents of the cells which have a specific font colour

    Your original mentioned column B, this last post says column B. Which one is it.

    And can you show a before and after situation. i.e. manually add what you expect to see once a cell has been cleared.

  7. #7
    Registered User
    Join Date
    07-05-2013
    Location
    Greece
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Macro to clear only the contents of the cells which have a specific font colour

    Book1.xlsx

    see the attached which includes comments

  8. #8
    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: Macro to clear only the contents of the cells which have a specific font colour

    Hi,

    OK, Will the title in column A always commence with the opening parentheses ( ?
    What about rows 11:13. Should these too also be split or deleted. And if deleted what's the rule to apply there since they have the same format as rows 3:6?

+ 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