+ Reply to Thread
Results 1 to 8 of 8

Colour cells based on colour of another cell

  1. #1
    Forum Contributor
    Join Date
    03-04-2014
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2019
    Posts
    756

    Colour cells based on colour of another cell

    Hello,

    In cell AB2 on Sheet2 I will have some data, which will change based on the data imported into the spreadsheet. This cell will be a particular colour, i.e. green fill with white font.

    On Sheet 6 I have a number of cells - namely C29, AD27 & BA26-BA33, which are to be coloured the same as AB2 on Sheet 2.

    Is there a way that I could get these cells in Sheet6 to "take on" the colours from AB2 in Sheet, potentially when pressing a commandbutton?


    Any help appreciated.

  2. #2
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Colour cells based on colour of another cell

    Yes.

    Are the colors manually set for AB2 or by a conditional format? If you attach a short example file, that helps us help you better.
    Last edited by Kenneth Hobson; 08-12-2019 at 12:34 PM.

  3. #3
    Forum Contributor
    Join Date
    03-04-2014
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2019
    Posts
    756

    Re: Colour cells based on colour of another cell

    Colours are manually set. So the cells in column AD2 will already be coloured manually.

  4. #4
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Colour cells based on colour of another cell

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    03-04-2014
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2019
    Posts
    756

    Re: Colour cells based on colour of another cell

    As shown in the attached document (all data removed for testing purpose)

    On Sheet2 the cells in AD on Sheet2 are green with red font.

    On Sheet6 there are cells that are orange with white font. I am looking for a code to copy the font from AD2 on Sheet 2 to these cells in Sheet6.
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    03-04-2014
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2019
    Posts
    756

    Re: Colour cells based on colour of another cell

    Your code was perfect! Thank you very much!

  7. #7
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Colour cells based on colour of another cell

    If you want to use the tab name rather than code name:
    Please Login or Register  to view this content.

  8. #8
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Hi ! Try this !


    According to the attachment as a very beginner starter just using the Macro Recorder :

    PHP Code: 
    Sub Macro1()
        [
    Sheet2!AD2].Copy
        
    [Sheet6!C29,AD27,BA26:BA33].PasteSpecial xlPasteFormats
        Application
    .CutCopyMode False
    End Sub 
    Do you like it ? So thanks to click on bottom left star icon « Add Reputation » !

+ 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. Font colour based on Cell colour
    By Geoff_ in forum Excel General
    Replies: 1
    Last Post: 05-29-2018, 09:48 AM
  2. How to change cell colour, if the colour is based on value from formula?
    By darah237 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-19-2016, 11:40 AM
  3. Replies: 6
    Last Post: 04-11-2016, 09:48 AM
  4. [SOLVED] Search cells based on student name, cell background colour and return a tally for colour
    By drof_06 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-26-2016, 04:31 AM
  5. Change colour of cells based on another cell's colour (Not value)
    By LTrain89 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-25-2013, 08:44 PM
  6. Colour change column chart based on cell colour
    By Alice21 in forum Excel General
    Replies: 11
    Last Post: 04-05-2011, 10:10 AM
  7. Changing a cell's colour basing on other cells' colour
    By rhua5436 in forum Excel General
    Replies: 11
    Last Post: 09-23-2010, 05:49 AM

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