Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Cells.Find for text w/ line break

try this. i entered test <alt<entercolumn 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" (notmorespam) wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default 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<entercolumn 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" (notmorespam) wrote in message
...
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
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
How do I create a line break writing text within a cell? Shel Excel Discussion (Misc queries) 1 December 11th 08 12:19 AM
Automatic line break in cells vertblancrouge Excel Discussion (Misc queries) 4 November 5th 08 06:58 PM
Force line break based on text Quizologist Excel Discussion (Misc queries) 3 June 4th 08 05:46 PM
concantenatring 2 cells with with a line break dick Excel Discussion (Misc queries) 7 June 8th 06 06:27 AM
How to do a line break in a text formula TJCacher Excel Programming 2 April 13th 04 02:39 AM


All times are GMT +1. The time now is 06:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"