xlf | GetWS2UFcolor function


GetWS2UFcolor - about the function


Description: returns the Fill color of a worksheet cell in UserForm (UF) &H hex & format 11 character format.

Syntax: GetWS2UFcolor(Reference).

Arguments: Reference (required): a WS cell.


xlf-ws-rgb-2-uf-color
Fig 1: function GetWS2UFcolor - returns WS color in UF &H...hex...& 11 character format

GetWS2UFcolor - the VBA code



Code 1: Function GetWS2UFcolor returns the Fill color of a WS cell in UF &H...hex...& 11 character format
Function GetWS2UFcolor(Reference As Range) As String
    GetWS2UFcolor = "&H" & Right("000000" & Hex(Reference.Interior.Color), 8) & "&"
End Function