Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Make field Fixed lenght

Hi there,
I have following formula in sheet2 A1 ="H"&Sheet1!B3&Sheet1!D3

Which I get HABC TEST20060817, but is it possible to always make the customer
name field lenght 30?
HABC TEST 20060817
HXYZRAY TEST 20060817

The actual customer name might be 7 digits, 10 digits or 15. So I'm trying
to make it fixed lenght of 30 digits.
B3 is the customer name field.

Would appreciate any info anyone might have. Not sure if this can be done.

Thank you,
J
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 644
Default Make field Fixed lenght

="H" & Sheet1!B3 & LEFT(" ",30 - LEN("H" &
Sheet1!B3) - LEN(Sheet1!D3)) & Sheet1!D3

HTH

Charles

Juan wrote:
Hi there,
I have following formula in sheet2 A1 ="H"&Sheet1!B3&Sheet1!D3

Which I get HABC TEST20060817, but is it possible to always make the customer
name field lenght 30?
HABC TEST 20060817
HXYZRAY TEST 20060817

The actual customer name might be 7 digits, 10 digits or 15. So I'm trying
to make it fixed lenght of 30 digits.
B3 is the customer name field.

Would appreciate any info anyone might have. Not sure if this can be done.

Thank you,
J


  #3   Report Post  
Posted to microsoft.public.excel.programming
Les Les is offline
external usenet poster
 
Posts: 240
Default Make field Fixed lenght

You can use the LEFT string function directly in the cell.
i.e
=LEFT("H"&Sheet1!B3&Sheet1!D3,30)

--
Les Torchia-Wells


"Juan" wrote:

Hi there,
I have following formula in sheet2 A1 ="H"&Sheet1!B3&Sheet1!D3

Which I get HABC TEST20060817, but is it possible to always make the customer
name field lenght 30?
HABC TEST 20060817
HXYZRAY TEST 20060817

The actual customer name might be 7 digits, 10 digits or 15. So I'm trying
to make it fixed lenght of 30 digits.
B3 is the customer name field.

Would appreciate any info anyone might have. Not sure if this can be done.

Thank you,
J

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Make field Fixed lenght

Hello Charles/Les,

thanks for the quick reply.
Charles, I changed yours to
="H" & Sheet1!B3 & LEFT(" ",30 -
LEN(Sheet1!B3)) & Sheet1!D3
Which gives me exactly what I want. Your code was giving me 21, I think
becuase You were including the H and Date. But was able to figure it out.

So thank you both of you for the help.

Have a good weekend.
J

"Die_Another_Day" wrote:

="H" & Sheet1!B3 & LEFT(" ",30 - LEN("H" &
Sheet1!B3) - LEN(Sheet1!D3)) & Sheet1!D3

HTH

Charles

Juan wrote:
Hi there,
I have following formula in sheet2 A1 ="H"&Sheet1!B3&Sheet1!D3

Which I get HABC TEST20060817, but is it possible to always make the customer
name field lenght 30?
HABC TEST 20060817
HXYZRAY TEST 20060817

The actual customer name might be 7 digits, 10 digits or 15. So I'm trying
to make it fixed lenght of 30 digits.
B3 is the customer name field.

Would appreciate any info anyone might have. Not sure if this can be done.

Thank you,
J



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
how do I sum fields down through a fixed field value. rgisla Excel Discussion (Misc queries) 0 November 23rd 09 09:45 PM
fixed cell lenght Bob Excel Discussion (Misc queries) 1 August 19th 08 08:38 AM
A fixed field format needs fronting zeroes for each cells value. CommerceMary Excel Worksheet Functions 8 July 25th 07 08:44 PM
How to make a field created a part of the Pivot Table Field List? drhell Excel Discussion (Misc queries) 0 January 29th 07 11:13 PM
Export file to CSV delimited with fixed field length Plucky Duck Excel Discussion (Misc queries) 2 May 28th 05 11:01 PM


All times are GMT +1. The time now is 12:59 AM.

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"