Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default cell = null if conditions apply

Hi,

Like to pose a question to everyone here. With the codes below, I
would like to let dcheckerror be null if theVals(i,2) returns a value
that is not numeric. Currently, the codes causes the return of the
number 999999 is the value returned is not numeric.

In addition, how can I ensure that if the value returned to the cell
is #N/A Tim or #N/A Sec, it also becomes null?

Think it's to do with the following lines of codes below, and to add
certain checks to these lines of codes.

If Not IsNumeric(theVals(i, 2)) Then
dcheckerror = 999999

Pls help, thanks.

Best regards,
Gerard

****************

With ActiveSheet
noRows = Application.CountA(.Columns(1))
AdjustednoRows = noRows + 2
theVals = .Range(.Cells(3, 1), .Cells(AdjustednoRows&, 2))
End With

For i = 1 To noRows
If Not IsNumeric(theVals(i, 2)) Then
dcheckerror = 999999
Else
dcheckerror = theVals(i, 2)
End If
RTUpdate CStr(theVals(i, 1)), dcheckerror ' CDbl(theVals(i, 2))
Next i

****************
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 2003 count if multple conditions apply Josie Excel Worksheet Functions 2 January 22nd 09 03:15 PM
How many conditions can I apply to a cell? I need to apply 8. Markus Excel Discussion (Misc queries) 2 July 10th 08 01:06 PM
Adding today's date if certain conditions apply Daniel Lapin Excel Worksheet Functions 1 January 29th 07 06:52 PM
cell value based on null/not null in another cell spence Excel Worksheet Functions 1 February 18th 06 11:49 PM
Summing if several conditions apply [email protected] Excel Worksheet Functions 3 December 1st 05 04:52 PM


All times are GMT +1. The time now is 10:58 AM.

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

About Us

"It's about Microsoft Excel"