Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Erik Millerd
 
Posts: n/a
Default How do I limit what text is displayed?

I have a cell linked to an Access database field. This field contains carrage
returns. I want to display only the data before the 1st carrage return. Is
there a way to do this? Perhaps useing the LEN, LEFT and other functions?
BTW this is in Excle and Access 2000.
  #2   Report Post  
ScottO
 
Posts: n/a
Default

If the text you wanted to strip down was in A1, then you could use a formula
like
=LEFT(A1,FIND(CHAR(10),A1)-1)
You may be able to adjust the formula to suit your need.

BTW Char(10) is the equivalent of a shift+enter in Excel.

Rgds,
ScottO

"Erik Millerd" wrote in message
...
| I have a cell linked to an Access database field. This field contains
carrage
| returns. I want to display only the data before the 1st carrage return. Is
| there a way to do this? Perhaps useing the LEN, LEFT and other functions?
| BTW this is in Excle and Access 2000.


  #3   Report Post  
Erik Millerd
 
Posts: n/a
Default



"ScottO" wrote:

If the text you wanted to strip down was in A1, then you could use a formula
like
=LEFT(A1,FIND(CHAR(10),A1)-1)
You may be able to adjust the formula to suit your need.

BTW Char(10) is the equivalent of a shift+enter in Excel.

Rgds,
ScottO

"Erik Millerd" wrote in message
...
| I have a cell linked to an Access database field. This field contains
carrage
| returns. I want to display only the data before the 1st carrage return. Is
| there a way to do this? Perhaps useing the LEN, LEFT and other functions?
| BTW this is in Excle and Access 2000.


Thanks Scott!!

I have one other question. I put this in cell A2. This works great, but if
A1 does not have a CHR(10) a #Value error is returned. I think that an IF
function will work to say that IF A1 has a CHR(10) then perform the above
function, else , just = A1. Is this correct?
  #4   Report Post  
ScottO
 
Posts: n/a
Default

Try this ...
=IF(ISERROR(FIND(CHAR(10),A1)),A1,LEFT(A1,FIND(CHA R(10),A1)-1))
Which in English translates (loosely) as "If you can't find a
Carriage Return in the text, then give me the text, otherwise find
where the Carriage Return is and give me the part of the text before
it".

Rgds,
ScottO

"Erik Millerd" wrote in
message ...
|
|
| "ScottO" wrote:
|
| If the text you wanted to strip down was in A1, then you could
use a formula
| like
| =LEFT(A1,FIND(CHAR(10),A1)-1)
| You may be able to adjust the formula to suit your need.
|
| BTW Char(10) is the equivalent of a shift+enter in Excel.
|
| Rgds,
| ScottO
|
| "Erik Millerd" wrote in
message
| ...
| | I have a cell linked to an Access database field. This field
contains
| carrage
| | returns. I want to display only the data before the 1st carrage
return. Is
| | there a way to do this? Perhaps useing the LEN, LEFT and other
functions?
| | BTW this is in Excle and Access 2000.
|
|
| Thanks Scott!!
| I have one other question. I put this in cell A2. This works great,
but if
| A1 does not have a CHR(10) a #Value error is returned. I think that
an IF
| function will work to say that IF A1 has a CHR(10) then perform the
above
| function, else , just = A1. Is this correct?


  #5   Report Post  
Erik Millerd
 
Posts: n/a
Default

Thank you very much!!
I would never have figured that out as I haven't seen the ISERROR before.
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
formula is displayed as literal text instead of formula result carlossaltz Excel Discussion (Misc queries) 2 July 1st 05 09:26 PM
Is there a limit on amount of text that can go into a cell? joodles Excel Discussion (Misc queries) 3 June 14th 05 09:51 PM
Text in autoshape not displayed Gaurav Excel Discussion (Misc queries) 2 April 1st 05 05:57 PM
Text wider than one cell is not displayed in the next empty cell Len Pace Excel Discussion (Misc queries) 5 February 18th 05 12:24 AM
Any way to get around the 240-character line limit on text output? awp Excel Discussion (Misc queries) 3 December 14th 04 11:59 PM


All times are GMT +1. The time now is 05:20 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"