ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Format single column cells to be 6 characters long (https://www.excelbanter.com/excel-worksheet-functions/44972-format-single-column-cells-6-characters-long.html)

bubberz

Format single column cells to be 6 characters long
 

I have a sheet with a single column, but there are about 3700 rows.
Some are 4 to 5 characters long. I need them all 6 char long.

Below is kinda what I need to do (add zeros to the left side to make
the cells 6 chars long):

If Len(x) = 4 then "00"+X
Else
If len(x) = 5 then "0"+X
End If


--
bubberz
------------------------------------------------------------------------
bubberz's Profile: http://www.excelforum.com/member.php...o&userid=27181
View this thread: http://www.excelforum.com/showthread...hreadid=466838


Anne Troy

Just do Format--Cells, Custom and type six zeroes into the box. See:
http://www.officearticles.com/excel/...soft_excel.htm
************
Anne Troy
www.OfficeArticles.com


"bubberz" wrote in
message ...

I have a sheet with a single column, but there are about 3700 rows.
Some are 4 to 5 characters long. I need them all 6 char long.

Below is kinda what I need to do (add zeros to the left side to make
the cells 6 chars long):

If Len(x) = 4 then "00"+X
Else
If len(x) = 5 then "0"+X
End If


--
bubberz
------------------------------------------------------------------------
bubberz's Profile:
http://www.excelforum.com/member.php...o&userid=27181
View this thread: http://www.excelforum.com/showthread...hreadid=466838




bubberz


That's exactly what I stumbled on!

Thanks for the post!


--
bubberz
------------------------------------------------------------------------
bubberz's Profile: http://www.excelforum.com/member.php...o&userid=27181
View this thread: http://www.excelforum.com/showthread...hreadid=466838



All times are GMT +1. The time now is 08:54 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com