Cells.Find for text w/ line break

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top