Copy color from range of cells
I'm trying to copy color from cell to cell (not actually range) but it does not work, I always get #VALUE error.
This is my code, it's self-explanatory (the idea is to copy background color, content can be set as blank):
Code:
Public Function colorBG(src As Range) As String
ActiveCell.Interior.ColorIndex = src.Interior.ColorIndex
colorBG = ""
End Function
I've even tried using source and destination (dest.Interior.ColorIndex = src.Interior.ColorIndex) but it doesn't work.
Any ideas what am I doing wrong? :-/