UDF to return as text

  • Thread starter Thread starter Fan924
  • Start date Start date
F

Fan924

This UDF returns a Hex number. I would like it to change the cell
format to text. Thanks,

Public Function DecToHex(DecNumber As Variant) As String
DecToHex = Right("0" & Hex(DecNumber), 2)
End Function
 
This UDF returns a Hex number. I would like it to change the cell
format to text. Thanks,

Public Function DecToHex(DecNumber As Variant) As String
DecToHex = Right("0" & Hex(DecNumber), 2)
End Function

A Function can only return a value. It cannot change the environment.
--ron
 
Back
Top