Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The user selects a cell and presses the delete key. Now, would it be possible
to determine if the user pressed the delete key on the SheetChange event handler? I tried the GetKeyState function. It works fine the first time, but after the function always returns positive, the key has been pressed. My intension is to determine if the user is deleting the content on a cell. If it is true, then the routine deletes the contents of other cells on the sheet. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Why not just check the contents of the cell at the change event. If the cell
is blank then... Private Sub Worksheet_Change(ByVal Target As Range) If Trim(Target.Value) = Empty Then MsgBox "Empty Cell" End If End Sub This catches both delete and backspace. -- HTH... Jim Thomlinson "HLong" wrote: The user selects a cell and presses the delete key. Now, would it be possible to determine if the user pressed the delete key on the SheetChange event handler? I tried the GetKeyState function. It works fine the first time, but after the function always returns positive, the key has been pressed. My intension is to determine if the user is deleting the content on a cell. If it is true, then the routine deletes the contents of other cells on the sheet. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
If pressed no to msgbox, then exit sub | Excel Programming | |||
Delete is Pressed then Stop | Excel Programming | |||
Which button was pressed? | Excel Programming | |||
Trapping key pressed in a worksheet | Excel Programming | |||
ComboBox DropDown when Key is pressed | Excel Programming |