Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How DO I set a fixed length column in Excel 4

Status
Not open for further replies.

mdl2

Programmer
Apr 12, 2002
25
CA
How do I set a fixed length text column in excel. I want first name and last name to export as 30 characters each regardless if there are less charaters entered.


Thanks

 
Hi,

Do you want the COLUMN WIDTH set or do you want the VALUE that is entered. padded with SPACES to a length of 30?

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 

I want the VALUE that is entered. padded with SPACES to a length of 30.
 
This cannot be done on the sheet without VBA code.

You can, however set up a formula in another column like this if your data is entered in A1
[tt]
=A1&Left(" ",30-Len(A1))
[/tt]
:)

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Hi Skip,

your formula would be easier to read if you generated the spaces like this:

=A1&REPT(" ",30-LEN(A1))

No offemce mate.

Cheers, Glenn.
 
Great additional thought Glenn. You guys are awesome! Here I thought I knew some stuff about Excel. I am constantly surprised by my ignorance.

"The more you know, the more you know you don't"
- my own little quote I like.

Cheers!!!!!!
 
Glenn,

Thanx! I have never used REPT, but I will now!

==> * :)

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Thanks for the stars guys :)

I'll have a beer tonight to celebrate.

Cheers, Glenn [cheers]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top