LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default Error Search

Hi Cyberwolf,

Hope this helps.

Sub Find_Error()
Dim wks As Worksheet 'Each worksheet in workbook
Dim rngToSearch As Range
Dim rngFound As Range
Dim strFirstAddress As String
Dim strToFind

strToFind = "#N/A"
For Each wks In Worksheets
Set rngToSearch = wks.Cells

Set rngFound = rngToSearch.Find(What:=strToFind, _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=False)

If Not rngFound Is Nothing Then
strFirstAddress = rngFound.Address
Do
'Put your code here to handle the error
rngFound.Interior.ColorIndex = 6

Set rngFound = rngToSearch.FindNext(rngFound)
Loop Until rngFound.Address = strFirstAddress
End If

Next wks

End Sub

Regards,

OssieMac


 
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
Search Formual Error Christopher Naveen[_2_] Excel Worksheet Functions 4 September 19th 08 09:43 PM
IsError error on Search MFINE Excel Discussion (Misc queries) 6 August 28th 07 05:26 PM
Error handling in a search michaelberrier Excel Discussion (Misc queries) 2 May 21st 06 07:08 PM
Error 1004 in search/copy ron_dallas Excel Programming 3 November 4th 05 02:34 AM
The search key was not found error Nydia New Users to Excel 0 April 27th 05 03:09 PM


All times are GMT +1. The time now is 01:19 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"