Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
unlock last set of rows
Is there a way to unlock the last row in a worksheet?
I have a data sheet that has columns A-E filled with information. It is locked and protected by excel. But say i want the user to be able to unlock the last row say its 50. So start from row 50 they can unlock it. I figured the code would have to be placed in the before change of the worksheet or whenever they activate the worksheet. Private Sub Worksheet_Activate() Dim ri As Long ' Row Index used to know which row results should paste into Dim wksDisplayResults As Worksheet ' Output sheet Set wksDisplayResults = Worksheets(Sheet10.Name) ri = wksDisplayResults.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Select End Sub this finds the last cell but i cant get it so that it unlocks the last row as well. i thought ri = wksDisplayResults.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).unprotect password:="mypassword" would work but it doesnt. any ideas? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
unlock last set of rows
You unprotect worksheet, not cells.
wksDisplayResults.Unprotect Password:="ABCD" wksDisplayResults.Cells(Rows.Count, 1).End(xlUp _ ).Offset(1, 0).EntireRow.Locked = False wksDisplayResults.protect Password:="ABCD" -- Regards, Tom Ogilvy "RigasMinho" wrote: Is there a way to unlock the last row in a worksheet? I have a data sheet that has columns A-E filled with information. It is locked and protected by excel. But say i want the user to be able to unlock the last row say its 50. So start from row 50 they can unlock it. I figured the code would have to be placed in the before change of the worksheet or whenever they activate the worksheet. Private Sub Worksheet_Activate() Dim ri As Long ' Row Index used to know which row results should paste into Dim wksDisplayResults As Worksheet ' Output sheet Set wksDisplayResults = Worksheets(Sheet10.Name) ri = wksDisplayResults.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Select End Sub this finds the last cell but i cant get it so that it unlocks the last row as well. i thought ri = wksDisplayResults.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).unprotect password:="mypassword" would work but it doesnt. any ideas? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Unlock VBE | Excel Discussion (Misc queries) | |||
How to Unlock | New Users to Excel | |||
unlock hidden rows when 'unhide' is greyed out? | Excel Worksheet Functions | |||
how do i password protect an .xls file? how do i unlock it for automation. e.g. want to unlock and access a .xls from another .xls macro. | Excel Worksheet Functions | |||
Unlock sheet | Excel Programming |