Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
How can I protect a range of cells, so that Macros will work in those cells,
but users cannot access them? |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Lock the cells and protect the worksheet. Have the macro unprotect the sheet
and then reprotect it when done. ActiveSheet.Unprotect Password:="mypassword" 'Do Stuff ActiveSheet.Protect Password:="mypassword" There are a lot of potential options for protection so I would recommend that you use the marco recorder to record you sheet protection to get all of the conditions. NOTE: The recorder will not record the password, you need to add this section manually This is a sample of what you may get ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:= _ True, AllowFormattingCells:=True, AllowFormattingColumns:=True, AllowFormattingRows:=True Simply add the condition Password:="mypassword" like this ActiveSheet.Protect Password:="mypassword",DrawingObjects:=False, Contents:=True, Scenarios:= _ True, AllowFormattingCells:=True, AllowFormattingColumns:=True, AllowFormattingRows:=True -- If this helps, please remember to click yes. "RK" wrote: How can I protect a range of cells, so that Macros will work in those cells, but users cannot access them? |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Of course if you put the password in the code, anyone can read it if the open
the visual basic editor... to protect against this you old protect the VBproject, from the editor window select menu ToolsVBAProject Properties... select the Protection tab and then check the lock option and enter a password, and remember to keep it in a secure place! Next time the file is opened your code will be protected. -- If this is the answer you hoped for please remember to click the yes button below... Kind regards Rik "Paul C" wrote: Lock the cells and protect the worksheet. Have the macro unprotect the sheet and then reprotect it when done. ActiveSheet.Unprotect Password:="mypassword" 'Do Stuff ActiveSheet.Protect Password:="mypassword" There are a lot of potential options for protection so I would recommend that you use the marco recorder to record you sheet protection to get all of the conditions. NOTE: The recorder will not record the password, you need to add this section manually This is a sample of what you may get ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:= _ True, AllowFormattingCells:=True, AllowFormattingColumns:=True, AllowFormattingRows:=True Simply add the condition Password:="mypassword" like this ActiveSheet.Protect Password:="mypassword",DrawingObjects:=False, Contents:=True, Scenarios:= _ True, AllowFormattingCells:=True, AllowFormattingColumns:=True, AllowFormattingRows:=True -- If this helps, please remember to click yes. "RK" wrote: How can I protect a range of cells, so that Macros will work in those cells, but users cannot access them? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Allowing Macros and Links in Excel 2007 | Excel Discussion (Misc queries) | |||
How do I protect a number of sheets allowing the user to add a com | New Users to Excel | |||
To Protect Excel documents and allowing only few cells to edit | Excel Worksheet Functions | |||
How can I lock worksheets while still allowing macros to operate? | Excel Discussion (Misc queries) | |||
Allowing Macros in Excel | Setting up and Configuration of Excel |