Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Kryptonix
 
Posts: n/a
Default Prompt Before Cell Deletion


Hiya,

I have an excel spreadsheet that I would like to change so that when\if
someone hits the delete key whilst in a cell a prompt appears asking
them to confirm that they wish to delete the contents of a cell. Is
this possible?

Apologies if I have posted this in the wrong forum, I am a newish user
and new to the site so was unsure whether to post here or the
Programming forum.


Thanks

Kevin


--
Kryptonix
------------------------------------------------------------------------
Kryptonix's Profile: http://www.excelforum.com/member.php...o&userid=28108
View this thread: http://www.excelforum.com/showthread...hreadid=476187

  #2   Report Post  
swatsp0p
 
Posts: n/a
Default


I'm sure what you ask is possible via VBA code. However, I would
question the logic behind such a move. First, that type of 'pop-up'
box is extremely annoying (ranks up there with flashing cells).
Second, it would not take long to figure out that all I would need to
do is erase the cell contents in the formula bar via backspace, simply
press the space bar then enter or just enter another value in the cell
to bypass the pop-up. Finally, there is the question of would you
apply this pop-up to a single cell only or to any selected range,
regardless of size?

Are you sure this is the route you want to go?

p.s. This forum is fine for this posting.


--
swatsp0p


------------------------------------------------------------------------
swatsp0p's Profile: http://www.excelforum.com/member.php...o&userid=15101
View this thread: http://www.excelforum.com/showthread...hreadid=476187

  #3   Report Post  
Kryptonix
 
Posts: n/a
Default Prompt Before Cell Deletion


Hi Bruce,

Thanks for the reply,

Yes, the guy whose spreadsheet it is has asked me to try and do this
for him so that he doesn't accidently delete anything, not
realise..then save over it. He does need to delete parts of the
spreadsheet now and then.

The pop up would need to apply on the whole spreadsheet so that if the
delete key was pressed anywhere on it the pop-up would appear.

If you could point me in the right direction on the VBA code that would
be great as I would like to give it a trial and see if he's happy with
it.

Thanks

Kevin


--
Kryptonix
------------------------------------------------------------------------
Kryptonix's Profile: http://www.excelforum.com/member.php...o&userid=28108
View this thread: http://www.excelforum.com/showthread...hreadid=476187

  #4   Report Post  
Kryptonix
 
Posts: n/a
Default Prompt Before Cell Deletion


Hiya,

Just an update, I have done some investigation and have come up with
the following code which seems to do what I want.

Sub proDangerousProcedure()

YesNo = MsgBox("Are you sure you wish to delete this data?", vbYesNo +
vbCritical, "Warning!!!!")
Select Case YesNo
Case vbYes
Macro1
Case vbNo
Exit Sub
End Select

End Sub


When I run a Macro I created the message pops up and if I say yes it
delete's the data and if it doesn't it leaves it.

This is great, my only problem now is how to get the macro to run when
I press the delete key on the keyboard? is this possible? At the
moment it works if I press a button I created on the toolbar but would
like it to activate it by pressing the delete key also.

Any elp would be gratefully appreciated :)

Thanks

Kevin


--
Kryptonix
------------------------------------------------------------------------
Kryptonix's Profile: http://www.excelforum.com/member.php...o&userid=28108
View this thread: http://www.excelforum.com/showthread...hreadid=476187

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
Cell color based upon cell value My View Excel Discussion (Misc queries) 11 July 6th 05 03:59 AM
cell color index comparison MINAL ZUNKE New Users to Excel 1 June 30th 05 07:11 AM
Cell Change Color - Need Help alani New Users to Excel 3 June 29th 05 03:50 PM
#REF! after cell deletion Colin G Eastwood Excel Discussion (Misc queries) 1 December 2nd 04 01:22 PM
VLookup resulting in a blank cell... KempensBoerke Excel Worksheet Functions 1 October 28th 04 09:57 PM


All times are GMT +1. The time now is 05:54 PM.

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"