I work with a lot of analytical sampling data and have to put together characterization documents. The worst case data is extracted and put into a summary type form based on the CAS number (chemical abstract number). Most though not all CAS numbers have published LD50 numbers by Species (animal). The LD50 and Species determine the Tox Code. I've got most of the extraction worked out but am having difficulty writing a UDF to detemine the Tox Code in vba.
The idea would be to pass the LD50 and Species to the function and spit out the letter (X, A, B, etc). Ultimately a SUMIF will be used to subtotal the different categories to pass to another form. I've included a workbook with three sheets -- one the table that determines Tox Code (reproduced from regulation), Calc sheet (where automated and manual entries meet), and a validation table (basic database of look-up values).
Open to suggestions. I originally tried nesting and if clause in a select case but the performance was less than stellar. I would like the Tox Code to populate only if there is a published LD50 and Species (i.e. present in look-up). None and not-listed in the LD50 show none or non-listed.
Bookmarks