Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default #value error

Hi,
Thanks for your reply.
This is just an example i have told you about col A and col C. I actually
have a lot of code behind. My major point of interest is protecting and
unprotecting the sheets while running these functions. If i dont protect the
sheet all the formulae are running fine so its not a problem with the
formulae i have but those formulae not getting calculated when i try to
unprotect the sheet at the beginning of function and protect it again at end
of the function.

Thanks.

"JBeaucaire" wrote:


There are several solutions, it would be best to know the kind of
formula that is in COLUMN C. But a generic answer is to first test your
formula with an IF(ISERROR() test, and suppress the error message. But
those error messages are useful, so suppressing them can also suppress
an issue. Up to you to know if that is the case.

Anyway, let's take a simple formula and wrap it in an IF(ISERROR()
trap.

If your formula was something like =VLOOKUP(A2,G2:H200,2,0) and that
was causing a #VALUE error, you can trap it like so:

=IF(ISERROR(VLOOKUP(A2,G2:H200,2,0)),0,VLOOKUP(A2, G2:H200,2,0))

This works, but forces your entire formula to run twice every time to
succeed. It would be better to know WHY you are getting the error and
perhaps test a simple piece of data instead, like:

=IF(A2<=0,0,VLOOKUP(A2,G2:H200,2,0))

That's much less intense.


--
JBeaucaire
------------------------------------------------------------------------
JBeaucaire's Profile: http://www.thecodecage.com/forumz/member.php?userid=73
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=46827


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
Error handling error # 1004 Run-time error [email protected] Excel Programming 3 May 20th 08 02:23 PM
Error Handling - On Error GoTo doesn't trap error successfully David Excel Programming 9 February 16th 06 05:59 PM
Form Err.Raise error not trapped by entry procedure error handler [email protected] Excel Programming 1 February 8th 06 10:19 AM
run-time error '1004': Application-defined or object-deifined error [email protected] Excel Programming 5 August 10th 05 09:39 PM
Automation Error, Unknown Error. Error value - 440 Neo[_2_] Excel Programming 0 May 29th 04 05:26 AM


All times are GMT +1. The time now is 03:39 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"