Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2003 count if multple conditions apply | Excel Worksheet Functions | |||
How many conditions can I apply to a cell? I need to apply 8. | Excel Discussion (Misc queries) | |||
Adding today's date if certain conditions apply | Excel Worksheet Functions | |||
cell value based on null/not null in another cell | Excel Worksheet Functions | |||
Summing if several conditions apply | Excel Worksheet Functions |