Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Finding all instances of ALT-ENTER on worksheet

I'd like to find all of the instances of ALT-ENTER on my worksheet and
highlight them. How would I do this? A VBA solution is fine.

Thanks,
Barb Reinhardt
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Finding all instances of ALT-ENTER on worksheet

Sub FindAltEnter()
Dim rng As Range, rng1 As Range
Set rng = Cells.Find(What:=Chr(10), _
After:=ActiveCell, _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not rng Is Nothing Then
sAddr = rng.Address
Do
If rng1 Is Nothing Then
Set rng1 = rng
Else
Set rng1 = Union(rng1, rng)
End If
Set rng = Cells.FindNext(rng)
Loop Until rng.Address = sAddr
End If
If Not rng1 Is Nothing Then
rng1.Select
Else
MsgBox "None found"
End If
End Sub


--
Regards,
Tom Ogilvy


"Barb Reinhardt" wrote:

I'd like to find all of the instances of ALT-ENTER on my worksheet and
highlight them. How would I do this? A VBA solution is fine.

Thanks,
Barb Reinhardt

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
Finding Multiple Instances in a List [email protected] Excel Worksheet Functions 1 April 27th 09 06:37 PM
Finding the total number of instances per year Rob Excel Worksheet Functions 3 January 7th 09 09:05 AM
Finding Character number for ALT-Enter Bob Ptacek Excel Worksheet Functions 8 November 19th 08 01:21 AM
Finding all instances of an ink color ldd Excel Discussion (Misc queries) 1 October 3rd 05 11:25 PM
counting instances of words in a worksheet cell CJ Excel Discussion (Misc queries) 2 December 22nd 04 02:49 AM


All times are GMT +1. The time now is 07:26 AM.

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"