Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dear Friends,
I want to check whether cell has #REF ! error? I am trying to get the values of a cell range. If any cell has an error "#REF!" then "ActiveCell.value" fails. Whats a way to check whether cell has an error so I can consider any default value for that cell. Regards, Vinit |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Vinit,
Try something like: '====================== Sub Tester() Dim rng As Range Dim rcell As Range Set rng = Range("A1:A50") For Each rcell In rng.Cells If IsError(rcell.Value) Then If rcell.Value = CVErr(2023) Then 'do something, e.g.: MsgBox "Error" End If End If Next End Sub '<<====================== --- Regards, Norman "Vinit" wrote in message ups.com... Dear Friends, I want to check whether cell has #REF ! error? I am trying to get the values of a cell range. If any cell has an error "#REF!" then "ActiveCell.value" fails. Whats a way to check whether cell has an error so I can consider any default value for that cell. Regards, Vinit |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Norman,
I solved it using a similar soltion. If(Application.IsError(ActiveCell.Value))Then MsgBox " Cell contains error handle it" Else MsgBox " Cell does not contain error" EndIf Regards, Vinit Norman Jones wrote: Hi Vinit, Try something like: '====================== Sub Tester() Dim rng As Range Dim rcell As Range Set rng = Range("A1:A50") For Each rcell In rng.Cells If IsError(rcell.Value) Then If rcell.Value = CVErr(2023) Then 'do something, e.g.: MsgBox "Error" End If End If Next End Sub '<<====================== --- Regards, Norman "Vinit" wrote in message ups.com... Dear Friends, I want to check whether cell has #REF ! error? I am trying to get the values of a cell range. If any cell has an error "#REF!" then "ActiveCell.value" fails. Whats a way to check whether cell has an error so I can consider any default value for that cell. Regards, Vinit |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
check or uncheck a check box based on a cell value | Excel Discussion (Misc queries) | |||
Copy and move check box (check boxes) with new cell link? | Excel Worksheet Functions | |||
Check for error.type in same cell | Excel Worksheet Functions | |||
Color cell if spell check finds an error | Excel Worksheet Functions | |||
Check if Conditional Format is True or False / Check cell Color | Excel Worksheet Functions |