ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Protection (https://www.excelbanter.com/excel-programming/351249-protection.html)

Gregc.

Protection
 
Hi

I have two questions.

The first one: is it possible to protect certain parts and not the
whole worksheet and,
The second one: is it possible to prevent a person changing the name of
a worksheet.

Thanks

Greg


Gary Keramidas

Protection
 
1. you can unlock the cells you don't want protected under format cells, and
then protect the sheet

2. use the sheet code name in any code you write, this is one way to assure your
code runs (if that's the reason you want to restrict the name change)
in the vbe, you can see the code name ( and change it) by clicking view and then
properties window. it's the one at the top with name in the ()

--


Gary


"Gregc." wrote in message
oups.com...
Hi

I have two questions.

The first one: is it possible to protect certain parts and not the
whole worksheet and,
The second one: is it possible to prevent a person changing the name of
a worksheet.

Thanks

Greg




Gary Keramidas

Protection
 
just to elaborate a little,
you can also choose tools/protection/protect workbook and then select structure
and the sheets will not be able to be renamed (use a password if you want to)

also, if you didn't want to do this, you could use something like this:

if you rename sheet1's tab and then ran this code, it would rename it back to
sheet1.

Sub test2()
Sheet1.Name = "Sheet1"
Worksheets("Sheet1").Range("a1").Value = 987
End Sub

sheet1.name is using the codename to rename the tab "sheet1"

if you wanted sheet1 to be named Jan

then this code would do that
Sub test2()
Sheet1.Name = "Jan"
Worksheets("Jan").Range("a1").Value = 123
End Sub


use either option you want.

--


Gary


"Gregc." wrote in message
oups.com...
Hi

I have two questions.

The first one: is it possible to protect certain parts and not the
whole worksheet and,
The second one: is it possible to prevent a person changing the name of
a worksheet.

Thanks

Greg





All times are GMT +1. The time now is 02:33 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com