View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Rosenfeld
 
Posts: n/a
Default Custom Format alphanumberic value with spaces

On Sun, 27 Nov 2005 20:21:02 -0800, "Bruce"
wrote:

c7454951000000cgvxx


You cannot format a text string using number formatting. One method is to use
TEXT functions, as written by McGimpsey, to have the display appear the way you
describe.

If the letters are always the same, you could just enter the numeric portion,
and use the custom format:

C-000-0000-000-000-"CG-VXX"

If the letters vary, you could use an event macro to do the custom formatting.

You would enter the full string as in your initial post, and then have the
event macro separate out the number from the text, and construct a custom
format. The data stored would be just the number.

You would have one custom format for each variation in alpha characters. Since
the number of custom formats is limited depending on the amount of memory, you
may wind up with too many formats.


--ron