Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default number format

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default number format


You need to set a custom format. Select cells, right
click, format cells, number, custom. In the "type" box
eneter 0000# that will give you the format you are
looking for........

-----Original 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
.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert numbers from text format to number format merlin68 Excel Discussion (Misc queries) 7 June 20th 07 07:03 PM
Replace million-billion number format to lakhs-crores format Sumit Excel Discussion (Misc queries) 1 December 9th 05 04:58 PM
convert text-format number to number in excel 2000%3f Larry Excel Discussion (Misc queries) 1 July 29th 05 08:18 PM
How do i change numbers in text format to number format? Greg New Users to Excel 1 December 14th 04 05:22 PM
excel format cells/Number/Category: Number problem Matts Excel Discussion (Misc queries) 5 December 9th 04 09:47 PM


All times are GMT +1. The time now is 09:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"