View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
5elpep 5elpep is offline
external usenet poster
 
Posts: 8
Default Format Number VBA

Sometimes it is useful to format numbers in a spreadsheet so that they
appear to be text.
To do this I just change the custom formatting as required - for
example "3M CO";"3M CO";"3M CO"
Now I have several hundred cells that need to be formatted in this
way.
I need a UDF that will take a value from one cell and format it
according to a string from another cell.

This is what I've got so far. The My_Value argument is number to be
formatted and the My_Formatting argument is the text that will be used
to format the cell.

Function Custom_Format(My_Value As Integer, My_Formatting As String)

Custom_Format = FormatNumber(My_Value, , My_Formatting, ,
My_Formatting)

End Function

Anyone got any ideas on where I'm going wrong??????????