Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Field length in Cells

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

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Field length in Cells

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)))

--
Regards,
Tom Ogilvy


"apv98 " wrote in message
...
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 column
contains data from a table(outside excel). I want to copy all the data
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. For
example the first field in my excel file represents a field which is 20
characters long and the next 10 characters long. The data for the first
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,
Paul


---
Message posted from http://www.ExcelForum.com/



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
Can data be sorted by the length in a field NanAnn58 Excel Worksheet Functions 4 October 6th 09 02:08 AM
//sk - Max length of a numeric field. sansk_23 Excel Worksheet Functions 4 September 25th 09 06:12 AM
Pad field length MarkM Excel Discussion (Misc queries) 2 April 4th 06 04:58 PM
Field length of VBA totals in Excel 2003 JoanE Excel Discussion (Misc queries) 2 August 17th 05 09:49 AM
How do I fix a field length? Karina Excel Discussion (Misc queries) 4 February 1st 05 04:39 PM


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

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

About Us

"It's about Microsoft Excel"