ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Read Only Problem (https://www.excelbanter.com/excel-programming/332415-read-only-problem.html)

ALEX

Read Only Problem
 
Hello

I want to make parts of a worksheet read only. However, when I do this it
interferes with my code running corretly. In particular, I get an error each
time I try to assign...

Selection.Interior.ColorIndex = 50

Is this a bug in Excel or can I get around this?

I have 'unlocked' the cells on my worksheet that I want to be able to be
manipulated by a user, and left the rest as locked so that they cannot be
maipulated.

I hear that you can write code along the lines of...

Application.Protect UserInterfaceOnly = False

....to protect wroksheets.

May this approhch be of more assitance?

Tom Ogilvy

Read Only Problem
 
Yes. UserInterfaceOnly:=True

as an argument to the protect method will allow your code to operate on the
worksheet while it is protected.

an alternative is to

Activesheet.Unprotect ' arguments

' make your changes
Activesheet.Protect ' arguments

--
Regards,
Tom Ogilvy


"Alex" wrote in message
...
Hello

I want to make parts of a worksheet read only. However, when I do this it
interferes with my code running corretly. In particular, I get an error

each
time I try to assign...

Selection.Interior.ColorIndex = 50

Is this a bug in Excel or can I get around this?

I have 'unlocked' the cells on my worksheet that I want to be able to be
manipulated by a user, and left the rest as locked so that they cannot be
maipulated.

I hear that you can write code along the lines of...

Application.Protect UserInterfaceOnly = False

...to protect wroksheets.

May this approhch be of more assitance?





All times are GMT +1. The time now is 02:47 PM.

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