Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default check for "#VALUE!"

Hi there.

I want to check if a cell's value is "#VALUE!". How can I do this?

If Cells(1, 1).Value = "#VALUE!" Then
...

... doesnt work.

Thanks



--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 340
Default check for "#VALUE!"

You can do it this way:

If ActiveCell.Value = CVErr(xlErrValue) Then
MsgBox "value error"
End If

more general is:

If IsError(ActiveCell.Value) Then
MsgBox "the cell contains an error value"
End If

Bob Flanagan
Macro Systems
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel

"fabalicious " wrote in message
...
Hi there.

I want to check if a cell's value is "#VALUE!". How can I do this?

If Cells(1, 1).Value = "#VALUE!" Then
..

.. doesnt work.

Thanks

F


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default check for "#VALUE!"

cheers

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default check for "#VALUE!"

You can use a combination of IsError and CVErr, something like:


Code
-------------------

If IsError(Cells(1, 1).Value) Then

If Cells(1,1).Value = CVErr(xlErrValue) Then

MsgBox "#Value Error in Cell"

Else

MsgBox "Other Error in Cell"

End If

Else

MsgBox "No Error in Cell"

End If

-------------------


Check the help files for more information.

T

--
Message posted from http://www.ExcelForum.com

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
when a "check box" is checked, a "result" to be shown in another c Lisa Ann Kashner Excel Discussion (Misc queries) 2 November 6th 07 01:32 AM
Check if cells contain the word "Thailand", return "TRUE" ali Excel Worksheet Functions 7 September 14th 07 09:53 AM
How can I check the "P" or "A" in the attendance sheet Capricorn Excel Worksheet Functions 1 June 8th 06 12:00 PM
create links to check boxes marked "good" fair"and "bad" pjb Excel Worksheet Functions 3 April 20th 06 02:17 AM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"