Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 34
Default Change #'s to Text macro

I need to be able to do the following:

I have a list of store #'s in column D (ex below). I need to format the
column as text and for any number that is less than 10, I need it to be
changed so that it has a leading 0 that will stay when saved as a CSV file.

I'm stuck on this so any help would be great. Thanks

Current How I want it

1 01
2 02
3 03
4 04
5 05
6 06
7 07
8 08
9 09
10 10
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,339
Default Change #'s to Text macro

in B1:

=TEXT(A1,"00")

where A1=1 etc

HTH

"MikeD1224" wrote:

I need to be able to do the following:

I have a list of store #'s in column D (ex below). I need to format the
column as text and for any number that is less than 10, I need it to be
changed so that it has a leading 0 that will stay when saved as a CSV file.

I'm stuck on this so any help would be great. Thanks

Current How I want it

1 01
2 02
3 03
4 04
5 05
6 06
7 07
8 08
9 09
10 10

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,173
Default Change #'s to Text macro

Mike

Pre-formatting the data as text will retain the leading zero's in the csv
file. Try opening it in Notepad an you'll see them.

It's the re-opening in Excel that strips the zeroes. About the only way
around this is to remove the csv extension, or save it as .txt and use
fileopen in Excel and then use the text import wizard (step 3) to mark the
column as text and all will be well

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
DTHIS
www.nickhodge.co.uk


"MikeD1224" wrote in message
...
I need to be able to do the following:

I have a list of store #'s in column D (ex below). I need to format the
column as text and for any number that is less than 10, I need it to be
changed so that it has a leading 0 that will stay when saved as a CSV
file.

I'm stuck on this so any help would be great. Thanks

Current How I want it

1 01
2 02
3 03
4 04
5 05
6 06
7 07
8 08
9 09
10 10


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Change #'s to Text macro

Select the column
format|Cells|Number tab|custom category
type:
00

And save as your .csv file.

Then use Notepad to verify that it worked--don't open the .csv file in excel.
Excel will strip the leading 0's in your .csv file when it opens the file.

MikeD1224 wrote:

I need to be able to do the following:

I have a list of store #'s in column D (ex below). I need to format the
column as text and for any number that is less than 10, I need it to be
changed so that it has a leading 0 that will stay when saved as a CSV file.

I'm stuck on this so any help would be great. Thanks

Current How I want it

1 01
2 02
3 03
4 04
5 05
6 06
7 07
8 08
9 09
10 10


--

Dave Peterson
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
Macro to change cell text color James C Excel Discussion (Misc queries) 1 August 12th 05 06:59 PM
Change of text or background color doesn't change on the screen. Susan Excel Discussion (Misc queries) 5 July 29th 05 07:18 PM
macro to change text to time JRV Excel Worksheet Functions 1 June 29th 05 09:36 PM
How do I change macro text with another macro? Eric Excel Discussion (Misc queries) 4 April 27th 05 11:20 PM
HOW TO CHANGE BAHTTEXT (THAI TEXT) TO ENGLISH TEXT IN EXCEL BASHIR Excel Worksheet Functions 0 March 29th 05 12:49 PM


All times are GMT +1. The time now is 05:43 PM.

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"