Results 1 to 4 of 4

changing cell triggers Run-time error 1004

Threaded View

  1. #1
    Registered User
    Join Date
    02-24-2004
    Posts
    12

    changing cell triggers Run-time error 1004

    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!
    Attached Files Attached Files
    Last edited by Langston; 09-09-2009 at 11:36 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1