Hello all,
I'm new to this board and hope you can help me with this question:
I wanted to lock and unlock a cell via Excel function rather than VBA or manually. So I found (at least I think) an Excel 4 macro for that, namely
The help says:
However, when I define a name, say, LockCell with the function
and use the name LockCell in a cell, it shows #NAME? error.
Does anyone know, what is wrong?
Thanks
I'm new to this board and hope you can help me with this question:
I wanted to lock and unlock a cell via Excel function rather than VBA or manually. So I found (at least I think) an Excel 4 macro for that, namely
Code:
CELL.PROTECTION(locked, hidden)
Macro Sheets Only
Equivalent to choosing the Protection tab in the Format Cells dialog box, which appears when you choose the Cells command from the Format menu. Allows you to control cell protection and display.
Arguments are logical values corresponding to check boxes in the Protection tab. If an argument is TRUE, Microsoft Excel selects the check box; if FALSE, Microsoft Excel clears the check box. If an argument is omitted and the setting has been previously changed from the defaults, the setting is not changed.
Syntax
CELL.PROTECTION(locked, hidden)
CELL.PROTECTION?(locked, hidden)
Locked corresponds to the Locked check box. The default is TRUE.
Hidden corresponds to the Hidden check box. The default is FALSE.
Remarks
Options selected in the Protection tab of the Format Cells dialog box or with the CELL.PROTECTION function are activated only when the Protect Sheet command is chosen from the Protection submenu on the Tools menu or the PROTECT.DOCUMENT function is used to select protection.
However, when I define a name, say, LockCell with the function
Code:
CELL.PROTECT(TRUE, FALSE)
Does anyone know, what is wrong?
Thanks