Automatically copy the color of a cell

dams6363 Posted messages 202 Registration date   Status Member Last intervention   -  
ccm81 Posted messages 11033 Status Member -
Hello everyone,

I'm struggling with an Excel spreadsheet. I'd like to simply copy the color of one cell to another.
I think I need to use a macro, but I have no idea how to create one.
Thank you for lending a hand, that would be nice.

See you soon

--
Our only victory is not winning, but getting back up after each failure...

2 answers

  1. Mike-31 Posted messages 18205 Registration date   Status Contributor Last intervention   5 147
     
    Good evening,

    Yes, if you color the cell manually, you will need to use VBA, there are several ways to write the code, for example to copy the color from B4 to G3

    Range("B4").Copy
    Range("G3").PasteSpecial Paste:=xlPasteFormats

    But in B4, if you could use conditional formatting, you could also pass with conditional formatting

    See you
    Mike-31

    Not knowing is not a failure, failure is the refusal to learn.
    0