ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   ISERROR for Multiple Workbooks (https://www.excelbanter.com/excel-programming/424250-iserror-multiple-workbooks.html)

TenacityWins

ISERROR for Multiple Workbooks
 
I may be trying to do the impossible. I want to use ISERROR to check
multiple open workbooks. If either workbook has information in specific
ranges/cells, I want that data returned, otherwise a "" response.

joel

ISERROR for Multiple Workbooks
 
MyError = False
For Each Cell In A
If IsError(Cell) = True Then
MyError = True
Exit For
End If
Next Cell
If MyError = False Then
For Each Cell In B
If IsError(Cell) = True Then
MyError = True
Exit For
End If
Next Cell
End If
If MyError = True Then
MsgBox ("Found an Error")
End If


"TenacityWins" wrote:

I may be trying to do the impossible. I want to use ISERROR to check
multiple open workbooks. If either workbook has information in specific
ranges/cells, I want that data returned, otherwise a "" response.


joel

ISERROR for Multiple Workbooks
 
I lost two lines when posting my response

Set A = Workbooks("Book1.xls").Range("A1:D7")
Set B = Workbooks("Book2.xls").Range("A1:D7")

MyError = False
For Each Cell In A
If IsError(Cell) = True Then
MyError = True
Exit For
End If
Next Cell
If MyError = False Then
For Each Cell In B
If IsError(Cell) = True Then
MyError = True
Exit For
End If
Next Cell
End If
If MyError = True Then
MsgBox ("Found an Error")
End If


"TenacityWins" wrote:

I may be trying to do the impossible. I want to use ISERROR to check
multiple open workbooks. If either workbook has information in specific
ranges/cells, I want that data returned, otherwise a "" response.



All times are GMT +1. The time now is 03:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com