I have an Excel 2003 spreadsheet used to calculate doses of medication. The value of several cells will depend on what optionbuttons the user selects.
I have entered the first two lines of code below w/o a problem to make certain calculations that are displayed in the specified cells. I then tried to make an additional calculation to display in cell 6,9, but it always triggers a "Application-defined or object-defined error". For troubleshooting purposes, I moved that line of code directly under the other two lines of similar code that I know work, and simplified the problem line to just arbitrarily set the value of the cell to a value of 2 (instead of the actual formula); it still triggers the error.
'CVM Pharmacy Protocol
Worksheets("CRI CALCULATOR").Cells(16, 3).Value = Worksheets("CRI CALCULATOR").Cells(5, 8).Value / ((Worksheets("CRI CALCULATOR").Cells(15, 3).Value * Worksheets("CRI CALCULATOR").Cells(3, 8).Value) / Worksheets("CRI CALCULATOR").Cells(10, 3).Value)
Worksheets("CRI CALCULATOR").Cells(16, 8).Value = ((Worksheets("CRI CALCULATOR").Cells(5, 8).Value / Worksheets("CRI CALCULATOR").Cells(17, 8).Value) * Worksheets("CRI CALCULATOR").Cells(10, 3).Value) / Worksheets("CRI CALCULATOR").Cells(3, 8).Value
Worksheets("CRI CALCULATOR").Cells(6, 9).Value = 2
I really would appreciate insight as to why this simple change in a cell value is triggering an error. I've attached the file. To trigger the error, pull up the worksheet "CRI Calculator" and click on either of the optionbuttons with blue text, or double-click on a name in the list-box. The worksheet is protected but it has no password, so it should unprotect easily. Thanks!
Bookmarks