Microsoft KB Archive/102490

= Microsoft Knowledge Base =

Excel: ENTER.DATA Command Causes Macro to Fail
Last reviewed: September 12, 1996

Article ID: Q102490

The information in this article applies to:


 * Microsoft Excel for Windows, versions 4.0, 4.0a
 * Microsoft Excel for the Macintosh, version 4.0

The ENTER.DATA macro function turns on Data Entry mode and allows you to enter data in a specified unprotected range on a protected worksheet. Page 132 of the "Function Reference" version 4.0, gives the following example for turning on Data Entry mode:

=ENTER.DATA(TRUE) =RETURN The documentation does not mention that a cell or a range of cells must be selected before you run a macro that contains ENTER.DATA; if no cell or range of cells is selected, the macro will fail. The active cell will not move and no error message will be displayed.

To halt the macro, press ESC.

NOTE: The manual does state that data will be entered in the current selection, but it does not mention that you must select the area first.

To successfully run a macro that contains the ENTER.DATA function:

 Manually select the unprotected cells and run the macro. -or-  Give the unprotected cells a defined name and use the SELECT function to select them at the beginning of the macro, as in the following sample macro: =SELECT(WORKSHEET.XLS!UNPROTECT) =ENTER.DATA(TRUE) =RETURN 