+ Reply to Thread
Results 1 to 3 of 3

Cells.Find for text w/ line break

  1. #1
    achidsey
    Guest

    Cells.Find for text w/ line break

    Excel Experts

    In several headings, I have broken the heading over two lines by using
    Alt+Enter to insert a line break between two words.

    When I try to search for this text, the search fails.

    In my VBA code, is there any way to successfully find this type of text.

    Thanks,
    Alan

    --
    achidsey

  2. #2
    Gary Keramidas
    Guest

    Re: Cells.Find for text w/ line break

    try this. i entered test <alt><enter>column in the B1, and i believe it was
    norman's code i adapted


    Sub tr()

    With Columns(2)
    Set fndRange = .Find(what:="test" & Chr(10) & "column",
    LookIn:=xlValues)
    End With
    If fndRange Is Nothing Then
    MsgBox "Not found"
    Else
    fndRange.Interior.ColorIndex = 35
    End If
    End Sub





    --


    Gary


    "achidsey" <[email protected](notmorespam)> wrote in message
    news:[email protected]...
    > Excel Experts
    >
    > In several headings, I have broken the heading over two lines by using
    > Alt+Enter to insert a line break between two words.
    >
    > When I try to search for this text, the search fails.
    >
    > In my VBA code, is there any way to successfully find this type of text.
    >
    > Thanks,
    > Alan
    >
    > --
    > achidsey




  3. #3
    achidsey
    Guest

    Re: Cells.Find for text w/ line break


    Gary,

    Thanks. This will be very helpful. Alan

    --
    achidsey


    "Gary Keramidas" wrote:

    > try this. i entered test <alt><enter>column in the B1, and i believe it was
    > norman's code i adapted
    >
    >
    > Sub tr()
    >
    > With Columns(2)
    > Set fndRange = .Find(what:="test" & Chr(10) & "column",
    > LookIn:=xlValues)
    > End With
    > If fndRange Is Nothing Then
    > MsgBox "Not found"
    > Else
    > fndRange.Interior.ColorIndex = 35
    > End If
    > End Sub
    >
    >
    >
    >
    >
    > --
    >
    >
    > Gary
    >
    >
    > "achidsey" <[email protected](notmorespam)> wrote in message
    > news:[email protected]...
    > > Excel Experts
    > >
    > > In several headings, I have broken the heading over two lines by using
    > > Alt+Enter to insert a line break between two words.
    > >
    > > When I try to search for this text, the search fails.
    > >
    > > In my VBA code, is there any way to successfully find this type of text.
    > >
    > > Thanks,
    > > Alan
    > >
    > > --
    > > achidsey

    >
    >
    >


+ 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