protect cells

J

JT

I have a macro that creates subtotals. I want to protect
several cells to the right of the subtotal so the user can
be prevented from entering any data in them.

I'm looking for suggestions how to accomplish this.
Thanks.
 
F

Frank Kabel

Hi
- select all cells
- goto 'Format - Cells - Protection' and uncheck 'Locked'

Now in your macro:
- set the .locked property of these cells to 'True'
- protect the sheet (e.g. activesheet.protect)
 
T

Tom Ogilvy

ActiveSheet.Unprotect
Cells.Locked = False
for each cell in Range("B4:B800")
if instr(1,cell.Text,"Subtotal",vbTextCompare) > 0 then
cell.offset(0,1).Resize(1,10).Locked = True
end if
Next
Activesheet.Protect
 
M

M

Lock the entire sheet, then Unlock the cells you want
people to be able to enter information into then protect
the sheet. This will allow the user to only enter data in
cells you want them to use.
 
Top