Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi: I have several worksheets that have locked cells and unlocked cells. User
are able to select unlocked cells to enter data. I have a VBA code I got off of another post, but it only allows users to select unlocked cells on each worksheet. How can I also allow users to format unlocked cells using VBA so I don't have to go one by one protecting each sheet in the workbook. Mainly I would like for them to be able to change the font color. This is what I currently have: Sub LockDown() For Each ws In Worksheets ws.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, _ Password:="elara" Next ws End Sub Sub UnlockAll() For Each ws In Worksheets ws.Unprotect Password:="elara" Next ws End Sub Thank You! |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
If you're protecting the worksheets in code, you can add another parm that
allows your code to do things that the user can't (not all things, but lots). Sub LockDown() For Each ws In Worksheets ws.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, _ Password:="elara", UserInterfaceOnly:=True Next ws End Sub Ana24 wrote: Hi: I have several worksheets that have locked cells and unlocked cells. User are able to select unlocked cells to enter data. I have a VBA code I got off of another post, but it only allows users to select unlocked cells on each worksheet. How can I also allow users to format unlocked cells using VBA so I don't have to go one by one protecting each sheet in the workbook. Mainly I would like for them to be able to change the font color. This is what I currently have: Sub LockDown() For Each ws In Worksheets ws.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, _ Password:="elara" Next ws End Sub Sub UnlockAll() For Each ws In Worksheets ws.Unprotect Password:="elara" Next ws End Sub Thank You! -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
ps. If you find things that you code can't do when the sheet is protected (even
with that parm set), you can modify your macro to: Unprotect the sheet do the work reprotect the sheet The user won't know what hit 'em <vbg. Ana24 wrote: Hi: I have several worksheets that have locked cells and unlocked cells. User are able to select unlocked cells to enter data. I have a VBA code I got off of another post, but it only allows users to select unlocked cells on each worksheet. How can I also allow users to format unlocked cells using VBA so I don't have to go one by one protecting each sheet in the workbook. Mainly I would like for them to be able to change the font color. This is what I currently have: Sub LockDown() For Each ws In Worksheets ws.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, _ Password:="elara" Next ws End Sub Sub UnlockAll() For Each ws In Worksheets ws.Unprotect Password:="elara" Next ws End Sub Thank You! -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Viewing of protected locked or unlocked cells | Excel Worksheet Functions | |||
Display locked or Unlocked cells | Excel Discussion (Misc queries) | |||
Scope priviledges for locked/unlocked cells | Excel Discussion (Misc queries) | |||
paste locked cells and unlocked cells in protected sheet | Excel Worksheet Functions | |||
how do you "select locked cells" w/o "select unlocked cells"? | Excel Discussion (Misc queries) |