View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Charlie Charlie is offline
external usenet poster
 
Posts: 703
Default Temporarily unprotect cell then protect afterwards

Select the cells you want to Lock or Unlock using menu
Format--Cells...--Protection. Then use menu Tools--Protection--Protect
Sheet to "Lock out" user entry. In your macro you will have to unprotect
then reprotect the sheet to make changes.

Sheets("Sheet1").Unprotect

(Code here to make changes to cells)

Sheets("Sheet1").Protect _
AllowFormattingCells:=True, _
AllowFormattingColumns:=True, _
AllowFormattingRows:=True, _
AllowSorting:=True, _
AllowFiltering:=True, _
AllowInsertingRows:=True

(Options as necessary, etc.)

"Reggie" wrote:

is it possbile to lock down every cell in a sheet then when a code is run
temporarily unlock a specific cell allow it to be modified/let a value be
entered in it, then lock the cell again so the user cant type over it?