View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
ryguy7272 ryguy7272 is offline
external usenet poster
 
Posts: 2,836
Default UDF to return as text

Maybe this:
=TEXT(A1, "0")

HTH,
Ryan---

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Ron Rosenfeld" wrote:

On Fri, 11 Dec 2009 13:41:40 -0800 (PST), Fan924 wrote:

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
.