![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Mar 2002
Posts: 5
|
Im using this code :
If Range("B8") < 18 And _ Range("B17") > 0 Then MsgBox "Error" End If End Sub but sometimes B8 is #N/A and therefore i get the 'run time error 13'. Anyway i can make this stop happening? cheers [ This Message was edited by: Coded on 2002-04-21 04:12 ] |
|
|
|
|
|
#2 |
|
BatCoder
Join Date: Feb 2002
Location: Turkey
Posts: 764
|
May be you want a simple Error Handler:
On Error GoTo ErrHandler If Range("B8") < 18 And _ Range("B17") > 0 Then MsgBox "Error" End If ErrHandler: |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
|
What do you want your code to do if #N/A is present?
Tom |
|
|
|
|
|
#4 |
|
New Member
Join Date: Mar 2002
Posts: 5
|
If it is #N/A i want nothing to happen, as in no msg box appearing
|
|
|
|
|
|
#5 |
|
Board Regular
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
|
Then use Smozgur's code or use
On Error Resume Next Tom |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|