Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with protected sheet

Status
Not open for further replies.

notuserfriendly

Programmer
May 7, 2004
82
SE
Hi I've got a sheet where the first five rows are supposed to be protected. I've done it by selecting the rows that are going to be protected and protected them and then the sheet.

The problem now is that when pasting data from other sheets
the rows containing the new data are locked too.
Help anyone?
 
That is because the "LOCKED" property of those cells will be TRUE. BEFORE you copy, set the Locked property to false (Format>Cells>Protection tab) - then copy and paste

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Yes this works, but the first row that I paste still gets marked as locked.

Code:
    Dim eRange
    Set eRange = ws.Range("A11:X11")
    With eRange
        .Locked = False
    End With
.
Another thing is that some columns always get locked (3 always are locked, even though I use a whole range when using .Locked = false like I show above.
 
that range is only 1 row.......

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Yes It's because I do it row by row and some rows are not handled so using ranges doesn't help (used hardcoded example). I justified some columns and by doing this they also got locked.

Thank's for the help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top