Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 312
Default Error check on sheet

Hello. Is there a way to simply scan Sheet1, and determine if any cells
equate to an error? I am taking data from a sheet and uploading it t an
external system. I'd like to have the macro stop as soon as it finds an
error anywhere in sheet1. Thanks so much.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Error check on sheet

You could use conditional formatting.

Select all the cells and use a formula of =ISERROR(A1) and choose a colour.
All errors are then flagged.

--
HTH

Bob Phillips

"Steph" wrote in message
...
Hello. Is there a way to simply scan Sheet1, and determine if any cells
equate to an error? I am taking data from a sheet and uploading it t an
external system. I'd like to have the macro stop as soon as it finds an
error anywhere in sheet1. Thanks so much.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 312
Default Error check on sheet

Thanks Bob. But this is scheduled code that automatically runs. I was
hoping for a solution that determines if errors exist and then exits the
sub. No user will see the conditional formatting of the errored cells.


"Bob Phillips" wrote in message
...
You could use conditional formatting.

Select all the cells and use a formula of =ISERROR(A1) and choose a

colour.
All errors are then flagged.

--
HTH

Bob Phillips

"Steph" wrote in message
...
Hello. Is there a way to simply scan Sheet1, and determine if any cells
equate to an error? I am taking data from a sheet and uploading it t an
external system. I'd like to have the macro stop as soon as it finds an
error anywhere in sheet1. Thanks so much.






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Error check on sheet

Steph,

You could try something like

Dim rng As Range
Set rng = ActiveSheet.UsedRange
Debug.Print Evaluate("SUMPRODUCT(--(ISERROR(" & rng.Address & ")))")

just take action if the result is greater than 0

--
HTH

Bob Phillips

"Steph" wrote in message
...
Thanks Bob. But this is scheduled code that automatically runs. I was
hoping for a solution that determines if errors exist and then exits the
sub. No user will see the conditional formatting of the errored cells.


"Bob Phillips" wrote in message
...
You could use conditional formatting.

Select all the cells and use a formula of =ISERROR(A1) and choose a

colour.
All errors are then flagged.

--
HTH

Bob Phillips

"Steph" wrote in message
...
Hello. Is there a way to simply scan Sheet1, and determine if any

cells
equate to an error? I am taking data from a sheet and uploading it t

an
external system. I'd like to have the macro stop as soon as it finds

an
error anywhere in sheet1. Thanks so much.








  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Error check on sheet



Steph wrote:
Hello. Is there a way to simply scan Sheet1, and determine if any cells
equate to an error? I am taking data from a sheet and uploading it t an
external system. I'd like to have the macro stop as soon as it finds an
error anywhere in sheet1. Thanks so much.



try this :
Dim oError
On Error Resume Next
Set oError = ActiveSheet.Cells.SpecialCells(xlCellTypeFormulas,
xlErrors)
If TypeName(oError) = "Empty" Then
Debug.Print "No Error"
Else
Debug.Print "Error"
End If
Err.Clear



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Error check on sheet

Dim oError
On Error Resume Next
Set oError = ActiveSheet.Cells.SpecialCells(xlCellTypeFormulas,
xlErrors)
If TypeName(oError) = "Empty" Then
Debug.Print "No Error"
Else
Debug.Print "Error"
End If
Err.Clear

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
Runtime 9 error Check. Mattlynn via OfficeKB.com Excel Worksheet Functions 2 September 23rd 09 10:59 AM
Check Activesheet for chart sheet or work sheet NSK Charts and Charting in Excel 1 July 17th 07 09:00 PM
Enable check box in protected sheet + group check boxes Dexxterr Excel Discussion (Misc queries) 4 August 2nd 06 12:00 PM
Sum up columns in different sheet with error check zeyneddine Excel Discussion (Misc queries) 13 July 10th 06 01:21 PM
how to use sumif function to check date in 1 sheet is < 2 sheet Bharat Saboo Excel Worksheet Functions 3 December 30th 05 07:10 AM


All times are GMT +1. The time now is 06:32 AM.

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

About Us

"It's about Microsoft Excel"