Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Erik Millerd
 
Posts: n/a
Default How do I remove all text in a cell after a specific character?

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  
moi
 
Posts: n/a
Default

I don't know if that will work with a worksheet function because i don't
know how to search for for an enter. With a VBA function it's easier:

Public Function OnlyB4Enter(wCell As String) As String
Dim i, l As Integer
Dim txtResult As String
l = Len(wCell)
i = InStr(1, wCell, vbCrLf, vbTextCompare)
If i 0 Then
txtResult = Left(wCell, (i - 1))
Else
txtResult = wCell
End If
OnlyB4Enter = txtResult
End Function

"Erik Millerd" <Erik schreef in bericht
...
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.



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
####### within a wrap text cell. OrlandoJayHu Excel Discussion (Misc queries) 2 May 18th 05 08:55 PM
advanced filter - can't match a long text cell simpsons_rule Excel Discussion (Misc queries) 7 May 14th 05 11:00 PM
Wrap text limits in Excel 2003 cell formatting Adelrose Excel Discussion (Misc queries) 1 April 19th 05 06:32 PM
reference the result of a formula in a text formatted cell jpwinston Excel Discussion (Misc queries) 1 February 7th 05 05:33 PM
Forcing text onto new line in cell Doug Poll New Users to Excel 2 December 3rd 04 12:09 PM


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