I have an excel file that is exported weekly that I need to convert certain cell colors into other colors. To accomplish this I found a User Defined Function =identifycolor (seen below) that I wrote into the conditional formatting to change the color of a cell if it met one of the color codes. This worked beautifully until I tried to save a copy of the file and send it to a coworker. When I got into VBA in the new file the UDF is still there but all of my cell colors are wrong. How do I fix this?
UDF working:
UDF not working:
VBA Code:
Function IdentifyColor(CellToTest As Range)
'Returns R + (256 * G) + (65536 * B)
'IdentifyColor = 255 for red, 65280 for green, etc.
IdentifyColor = CellToTest.Interior.Color
End Function
UDF working:
UDF not working: