Case select returning error when cell contains #N/A : how must i avoid this error

G

Gary Keramidas

maybe this will do what you want

Sub test()
If Not IsError(Range("C1").Value) Then
Select Case Range("C1").Value
Case 1
MsgBox "1"
Case 2
MsgBox "2"
End Select
End If
End Sub
 
L

Luc

Thanks for your help !!!!!

Luc

Gary Keramidas said:
maybe this will do what you want

Sub test()
If Not IsError(Range("C1").Value) Then
Select Case Range("C1").Value
Case 1
MsgBox "1"
Case 2
MsgBox "2"
End Select
End If
End Sub

--


Gary Keramidas
Excel 2003
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top