ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Case select returning error when cell contains #N/A : how must i avoid this error (https://www.excelbanter.com/excel-programming/438310-case-select-returning-error-when-cell-contains-n-how-must-i-avoid-error.html)

Luc[_8_]

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

Thanks,

Luc

Gary Keramidas

Case select returning error when cell contains #N/A : how must i avoid this error
 
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


"Luc" wrote in message
...
Title says it all

Thanks,

Luc



Luc[_8_]

Case select returning error when cell contains #N/A : how must i avoid this error
 
Thanks for your help !!!!!

Luc

"Gary Keramidas" <GKeramidasAtMSN.com schreef in bericht
...
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


"Luc" wrote in message
...
Title says it all

Thanks,

Luc




All times are GMT +1. The time now is 02:24 PM.

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