+ Reply to Thread
Results 1 to 5 of 5

How do I remove all text in a cell after a specific character?

  1. #1
    moi
    Guest

    Re: How do I remove all text in a cell after a specific character?

    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 [email protected]> schreef in bericht
    news:[email protected]...
    >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. #2
    moi
    Guest

    Re: How do I remove all text in a cell after a specific character?

    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 [email protected]> schreef in bericht
    news:[email protected]...
    >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. #3
    moi
    Guest

    Re: How do I remove all text in a cell after a specific character?

    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 [email protected]> schreef in bericht
    news:[email protected]...
    >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.




  4. #4
    Erik Millerd
    Guest

    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.

  5. #5
    moi
    Guest

    Re: How do I remove all text in a cell after a specific character?

    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 [email protected]> schreef in bericht
    news:[email protected]...
    >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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1