Locked Property Error

R

Raman325

Hey guys,

In one of my macros, I am trying to unlock a given cell by saying
Cells(row number, column letter).Locked = False. I have used it before
and it worked, but for some reason, I keep getting an error which
states:
Run-time error '1004':

Unable to set the Locked property of the Range class

The sheets are unprotected so that shouldn't be an issue. Does anyone
know how to fix this? Thanks in advance and please let me know if you
need more information.
 
D

Dave Peterson

Is the cell/range merged?

This worked ok when I merged A1:B1
Cells(1, 1).MergeArea.Locked = False

Maybe the rownumber and/or columnletter weren't correct?
 
R

Raman325

Thank you for the response. I checked the reference t omake sure it wa
correct and it was fine. It is part of a merged cell, however. If I us
the MergedArea reference like you have used, will it work on cells tha
haven't been merged as well
 
D

Dave Peterson

What happened when you tried it?

(It worked ok for me.)

Sometimes, it's just quicker to try it out.
 
R

Raman325

Sorry about that, unfortunately, I did not have access to the macro when
I had sent you that response. Thanks again for your help.
 

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