unprotected cells

G

geebee

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
 
J

JLGWhiz

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.
 
K

ker_01

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top