View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Damian Damian is offline
external usenet poster
 
Posts: 71
Default EnableSelection Protecting sheet question

I have a sheet which I need to protect:
I have this code (VBA)
With ActiveSheet
.Protect Password:="xxx"
.EnableSelection = xlUnlockedCells
End With

AND it works great. BUT I need to add to this so they cab use FormatCells,
FormatColumns and FormatRows.
When I wrote this:
With ActiveSheet
.Protect Password:="xxx"
.EnableSelection = xlUnlockedCells
.EnableSelection = xlFormatCells
.EnableSelection = xlFormatColumns
.EnableSelection = xlFormatRows
End With

IT DOES NOT WORK. Am I doing the code wrong?