![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Posts: 21
|
I'm writing a program for schoolkids and don't want them to alter any cells that are part of the assignment or to access VBA. The assignment involves clicking buttons that invoke macros. The macros change text in locked cells by deprotecting then reprotecting...
ActiveSheet.Unprotect ActiveCell.FormulaR1C1 = "hello" ActiveSheet.Protect This is the wrong approach because of its drawbacks.... 1) if a student tries to change a locked cell, a message box appears that tells him how to deprotect it. 2) a password option would be clumsy in a computer lab with 30 kids. 3) if the macro doesn't deprotect first, then a message box is invoked that gives students access to VBA (which they otherwise don't know exists) via the debug button. Is there a way for a macro to slip a cell text change under the veil of protection without these message boxes? And/or can the message box that explains how to deprotect the sheet be taken out or reworded? Thanks in advance |
|
|
|
|
|
#2 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Columbus, OH, USA
Posts: 3,519
|
Quote:
Then delete the line that begins "msgbox". HTH |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|