Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
However, instead of relying on string comparisons, you can also determine
what sort of data type you get back from the Value property, and if it's an error you can take further action. 1) Check the Value (which is of type Variant) with VarType(...) = vbError, or simply use IsError() 2) You can then use one of the constants from the XlCVError enumeration to figure out exactly which error you've got. Cheers, /MP "Damon" wrote: Thank you Norman that has fixed it! "Norman Jones" wrote: Hi Damon, Try replacing: If ActiveCell.Value = "#N/A" Then with If ActiveCell.Text = "#N/A" Then --- Regards, Norman "Damon" wrote in message ... Can anybody please tell me why I am getting a type mismatch error on the first line of this seemimgly simple bit of code? (i am using excell 2000) Sub NAdelete() If ActiveCell.Value = "#N/A" Then ActiveCell.Offset(0, 1).Activate ActiveCell.Offset(0, -1).EntireRow.Delete Else ActiveCell.Offset(0, 1).Activate End If End Sub Thank you in advance! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Visual Basic Error Run Time Error, Type Mismatch | Excel Discussion (Misc queries) | |||
Help: Compile error: type mismatch: array or user defined type expected | Excel Programming | |||
Why type mismatch - R/T error 13 | Excel Discussion (Misc queries) | |||
Befuddled with For Next Loop ------ Run - Time Error '13' Type Mismatch Error | Excel Programming | |||
Help with Error: Type Mismatch | Excel Programming |