ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   unprotected cells (https://www.excelbanter.com/excel-programming/431411-unprotected-cells.html)

geebee

unprotected cells
 
hi,

i would like to know if there is a way to protect a sheet so that most of
the cells are protected, but column d is unprotected. i am asking this
because for some reason on worksheet selection change, if i click somewhere
else in the sheet, or even select a range other than what is in the A_range
defined name range, i get a "type mismatch" error message. here is the code
i have:
if not intersect(target, range("A_range")) is nothing and
range(target.address).value < "" then
dim...

thanks in advance,
geebee


JLGWhiz[_2_]

unprotected cells
 
M aybe hadle it differently by making the second part if the If ...And
statement into a nested If

if not intersect(target, range("A_range")) is nothing Then
If range(target.address).value < "" then
'other code
End If
End If

that way the second part will be evaluated on.y if the first part is true.
As it is currently written, the first part can be false but it will attempt
to evaluate the And part anyhow.


"geebee" (noSPAMs) wrote in message
...
hi,

i would like to know if there is a way to protect a sheet so that most of
the cells are protected, but column d is unprotected. i am asking this
because for some reason on worksheet selection change, if i click
somewhere
else in the sheet, or even select a range other than what is in the
A_range
defined name range, i get a "type mismatch" error message. here is the
code
i have:
if not intersect(target, range("A_range")) is nothing and
range(target.address).value < "" then
dim...

thanks in advance,
geebee




ker_01

unprotected cells
 
geebee-

You didn't mention which version of Excel you are using; this works for me
in XL2003. Rightclick on the column, format cells/protection, then uncheck
the "locked" box. Then protect the sheet (allow users to select unlocked
cells, but not locked cells). Now you and your users can select cells in that
column only.

HTH,
Keith

"geebee" wrote:

hi,

i would like to know if there is a way to protect a sheet so that most of
the cells are protected, but column d is unprotected. i am asking this
because for some reason on worksheet selection change, if i click somewhere
else in the sheet, or even select a range other than what is in the A_range
defined name range, i get a "type mismatch" error message. here is the code
i have:
if not intersect(target, range("A_range")) is nothing and
range(target.address).value < "" then
dim...

thanks in advance,
geebee



All times are GMT +1. The time now is 09:56 AM.

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