Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Error

HI

The following code should check to find any errors in
formulas on sheet "Email"

It works fine if there are errors on the sheet but when
there are no errors it returns the error 'Run Time error
1004' No cells found.

I thought the 2 on error statements should handle this
error but they dont seem to work.

The Sheet that I am checking has formulas on the first 125
rows and columns b, c, d but only some of the formulas
will actually work due to some if statements. Can anyone
think of any reason for this happening.

Let me know if you require any further info.

TIA

Sub Exceptions_Report()
Dim rng As Range, rng1 As Range, rng2 As Range

Application.ScreenUpdating = False

With Worksheets("Email")
Set rng = .Range(.Cells(1, 1), .Cells(1, 1).End
(xlDown))
On Error Resume Next
On Error GoTo 0
Set rng1 = rng.Offset(0, 1).Resize(,
2).SpecialCells(xlFormulas, xlErrors)
If Not rng1 Is Nothing Then
Set rng2 = Intersect(rng1.EntireRow, .Range
("A:C"))
rng2.Cut Destination:=Worksheets
("Exceptions_Report").Range("A8")
End If
End With

Worksheets("Exceptions_Report").Select
Columns("A:A").HorizontalAlignment = xlLeft

Worksheets("Exceptions_Report").Select
With Worksheets("Exceptions_Report").PageSetup
.PrintTitleRows = "$1:$7"
.LeftMargin = Application.InchesToPoints
(0.748031496062992)
.RightMargin = Application.InchesToPoints
(0.748031496062992)
.TopMargin = Application.InchesToPoints
(0.984251968503937)
.BottomMargin = Application.InchesToPoints
(0.984251968503937)
.HeaderMargin = Application.InchesToPoints
(0.511811023622047)
.FooterMargin = Application.InchesToPoints
(0.511811023622047)
.CenterHorizontally = True
.Orientation = xlPortrait
End With

Application.ScreenUpdating = False
Exceptions.Show


End Sub
 
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
Excel 2007 - error saving file & error loading dll TinaF Excel Discussion (Misc queries) 0 July 1st 09 01:49 PM
Counting instances of found text (Excel error? Or user error?) S Davis Excel Worksheet Functions 5 September 12th 06 04:52 PM
I have Error 1919 Error Configuring ODBC dataSource Database Texanna1 Excel Discussion (Misc queries) 1 September 12th 06 06:35 AM
Syntax Error Runtime Error '424' Object Required sjenks183 Excel Programming 1 January 23rd 04 09:25 AM


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