Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default How to disable the delete key after deletion is made

Hello again

If the user presses the delete key to delete something entered, my program executes which I dont want. How can you
simply have the value deleted and then exit sub for example so the program doesnt continue further.

I have tried

Application.OnKey "{delete}" ', "matrix" ' not quite what Im looking for

if .Value = vbKeyDelete Then ' this does nothing
Exit Sub
endif

Thanks
Mike

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 863
Default How to disable the delete key after deletion is made

Do you mean that you have a Worksheet_Change event macro that you don't want
to run if the user has cleared the cell? If so,

Private Sub Worksheet_Change(ByVal Target As Range)
If IsEmpty(Target.Value) Then Exit Sub
'your code goes here
End Sub


On Sat, 22 Jan 2005 14:56:21 -0500, Susan Hayes wrote:

Hello again

If the user presses the delete key to delete something entered, my program

executes which I dont want. How can you
simply have the value deleted and then exit sub for example so the program

doesnt continue further.

I have tried

Application.OnKey "{delete}" ', "matrix" ' not quite what Im looking for

if .Value = vbKeyDelete Then ' this does nothing
Exit Sub
endif

Thanks
Mike


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I disable or delete an Add-In dhstein Excel Discussion (Misc queries) 2 April 13th 09 02:10 AM
Disable the Delete Key CarolK1968 Excel Discussion (Misc queries) 3 January 30th 08 07:20 PM
Disable Delete Kevin Excel Discussion (Misc queries) 0 July 29th 07 02:58 PM
Confirm Delete Message Disable RiosPapa New Users to Excel 2 October 7th 05 09:02 PM
Disable entire row delete on certain sheet Jason Excel Programming 4 April 15th 04 05:01 PM


All times are GMT +1. The time now is 06:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"