PritishS
Board Regular
- Joined
- Dec 29, 2015
- Messages
- 119
- Office Version
- 2007
- Platform
- Windows
Dear Sir/Madam,
I need a help to disable delete key and backspace key for a particular worksheet.
In details:
I'm using MS office 2007. I have a MS excel workbook with 88 sheets. All sheets are password protected except 88th (last one) worksheet. I want to disable delete and backspace operation from all 87 sheet but not for 88th sheet. I'm just learning Excel VB from internet and found some solutions. code is as below--
I used this code in 'Sheet1' (I thought using this code here (in perticular sheet) instead on ThisWorkBook would solve my problem, But it didn't)
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.OnKey Key:="{DEL}", Procedure:="AlertUser"
End Sub
Then inserted a new module and used below code to show message
Public Sub AlertUser()
MsgBox "you push the delete button"
End Sub
Its gives me desired result. But I don't want to disable the 'delete' 'backspace' function to last sheet(88th).
Is it possible to apply this code for a particular 'Sheet' instead of whole workbook??
Please help me on this...Thanks in Advance
Thanks
PritishS
I need a help to disable delete key and backspace key for a particular worksheet.
In details:
I'm using MS office 2007. I have a MS excel workbook with 88 sheets. All sheets are password protected except 88th (last one) worksheet. I want to disable delete and backspace operation from all 87 sheet but not for 88th sheet. I'm just learning Excel VB from internet and found some solutions. code is as below--
I used this code in 'Sheet1' (I thought using this code here (in perticular sheet) instead on ThisWorkBook would solve my problem, But it didn't)
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.OnKey Key:="{DEL}", Procedure:="AlertUser"
End Sub
Then inserted a new module and used below code to show message
Public Sub AlertUser()
MsgBox "you push the delete button"
End Sub
Its gives me desired result. But I don't want to disable the 'delete' 'backspace' function to last sheet(88th).
Is it possible to apply this code for a particular 'Sheet' instead of whole workbook??
Please help me on this...Thanks in Advance
Thanks
PritishS