Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I suggest you add a command button to the sheet with a caption like "Delete
selected cells'. Set the Locked property of this button to False (so it doesn't get locked when you protect the sheet). In the click event for the button, use VBA to unprotect the sheet, delete the selected cell(s), and reprotect the sheet. For example, Private Sub CommandButton1_Click() Dim C As Range ActiveSheet.Unprotect Password:="aaa" For Each C In Selection If C.Locked = False Then C.Delete Shift:=xlUp End If Next C ActiveSheet.Protect Password:="aaa", _ DrawingObjects:=True, Contents:=True End Sub This code looks at each cell selected be the user. If that cell is locked, it is not deleted. Selected cells that are not locked are deleted and the cells below shift upward. Hope this helps, Hutch "Dave Mathew" wrote: I just tried unlocking a row and it will allow me to delete the entire row but what I am wanting to do is select and delete a specific range of cells in a row, which it appears still isn't allowed even if I unlock the entire row... i.e. I can only delete a row by right clicking on the row header on the left and selecting delete, when I select a few cells in the row and right click on the selection the delete option is still grayed out. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I delete all names ranges in a workbook after freezing form | Excel Discussion (Misc queries) | |||
Delete user-defined charts | Charts and Charting in Excel | |||
delete user define setting | Charts and Charting in Excel | |||
delete or edit named dell ranges | Excel Discussion (Misc queries) | |||
How do I delete all named ranges in a sheet at one time? | Excel Worksheet Functions |