Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi Tom Thanks for your reply I have cells in the range AF9:AL9. Each cell may or may not contain the error #DIV/0! depending on the result of the calculation. Once the calculations have been performed I'd like the code to be able to look at each individual cell in that range to determine if it contains an error such as #DIV/0! and if so change it to '0'. If the cell contains a valid integer then the code will leave it alone and move onto the next cell in the range. Sorry for showing my ignorance but I dont understand where the W9 and Y9 etc comes in. and the lines starting with a question mark - is that part of the code? At the moment I have a command button that on clicking works out a lot of calculations and does so in a certain order. The results of some of those calculations unfortunately results in zero so when that result gets used as part of another calculation I get the error code. This is part of the code I have at the moment and I'm sure theres probably a better way to do it but I have to keep it simple as I'm not very conversant with VBA and I need to be able to follow whats going on - it works and thats what matters to me. I just need to tidy up those #DIV/0! erros if they appear. Cells(2, "AF").Value = Evaluate("=SUM((AE10 / (AE10+AC10))*100)") 'Lab sensitivity Cells(2, "AG").Value = Evaluate("=SUM((U10 / (U10+Z10))*100)") 'Lab specificity Cells(2, "AH").Value = Evaluate("=SUM((AC10 / (AC10+AE10))*100)") 'Lab FN rate Cells(2, "AI").Value = Evaluate("=SUM((Z10 / (U10+Z10))*100)") 'Lab FP Rate Cells(2, "AJ").Value = Evaluate("=SUM((AE10 / (AE10+Z10))*100)") 'Lab PPV Hope this makes it a bit clearer what I'm trying to do regards Steve -- ghobbit ------------------------------------------------------------------------ ghobbit's Profile: http://www.excelforum.com/member.php...o&userid=12385 View this thread: http://www.excelforum.com/showthread...hreadid=545233 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can change range to select active rows instead of :=Range("S10 | Excel Discussion (Misc queries) | |||
Change Range & Row | Excel Programming | |||
How do I change a range name back to the underlying data range? | Excel Worksheet Functions | |||
How can I dynamically change the range for Range("A1:M500")? | Excel Programming | |||
Change cell colour for a cell or range within a predefined range | Excel Programming |