Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a spreadsheet which has some macros associated with it and need to
make sure that columns are not deleted or inserted. For the case where the context menu is used to delete or insert a columns, the following code works because one has to select the entire column: Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Rows.Count = 65536 Then ActiveSheet.Protect Else ActiveSheet.Unprotect End If End Sub (The above code places the spreadsheet in the protection mode if an entire column is selected and unprotects it when a cell or range of cells is selected.) However, this does not work if someone decides to delete or insert using the Excel menu. I don't want to keep the sheet in a protected mode since this is too restrictive, but I do need a way to protect the columns. Any help with this is appreciated. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Enable/Disable Menu Items | Excel Programming | |||
Is is possible to disable certain menu items | Excel Programming | |||
Disable menu items with VBA | Excel Programming | |||
Disable entire row delete on certain sheet | Excel Programming | |||
HELP - How do I disable Excels menu items so others can't use | Excel Programming |