If you mean as a UDF, then I don't think it's possible because a UDF can only return a value; it can't do cell formatting of any kind, including text colouring.

As a VBA function/subroutine called from VBA on the other hand, then yes. For each source cell, loop through the Characters object one character at a time, copying the Text and various Font properties to the destination cell.