View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Locking Cells from list

by default, all cells are locked, so I assume you want to unlock all others

Activesheet.Unprotect Password:="ABC"
Cells.Locked = False
Range("A1,B9,C3:C5,F2,R32:Z29,M2,M5,M8").Locked = True
Range("Z1,AB9,AC3:AC5,BF2,BR32:BZ29,AM2,AM5,AM8"). Locked = True
Activesheet.Protect Password:="ABC"


--
Regards,
Tom Ogilvy


"Kurt Barr" wrote:

I have a list of cell addresses that I would like to build a macro for to
lock the cell when protection is enabled. The number of addresses that I have
is very large, so I don't want to have to key in each address by hand. Can
someone help me build a macro that will do this?