Field length in Cells

A

apv98

Hi,

I am very new to this forum. I have two queries:

1. I have got data in various columns in a work sheet. Each colum
contains data from a table(outside excel). I want to copy all the dat
in a row to one cell. This I acheived through the formula = A1 & B1--
etc. However I want to maintain the field length of each too. Fo
example the first field in my excel file represents a field which is 2
characters long and the next 10 characters long. The data for the firs
field is abcd and for the second is 1234.

What I want in the cell is ABCD 1234

Is it possible in excel to do this?

Thanks & regards,
Pau
 
T

Tom Ogilvy

to right justify
=rept(" ",10-len(trim(a1)))&trim(a1)&rept(" ",10-len(trim(b1))) & trim(B1)

to left justify
=trim(a1)&rept(" ",10-len(trim(a1)))&trim(B1)&rept(" ",10-len(trim(b1)))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top