Thread: number format
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default number format

ActiveCell.Value = "'" & right(format(Activecell.value,"00000"),5)

--
Regards,
Tom Ogilvy

"Jo" wrote in message
...
Hi
I am trying to enter data onto a worksheet from a slide
bar on a userform. I need the number to be in a 5
character format i.e. if 5 is entered 00005 is displayed.
I can do this by formating to a zip code. The problem
occurs when I save as a text file, 00005 becomes 5 again.
Is there some code I could write which changes 5 to 00005?
Thanks
Jo