Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Confirming a deletion


Hi,
I am very new to writing Macro's, etc, so hopefully this will be a
easy question for all you experts!

I have a spreadsheet with several rows of data, that occassionally,
single row will need to be deleted from. I want a confirmation messag
to come up when the row is selected for deletion with something lik
"Are you sure you want to delete?"

Can this be done without knowing exactly which row is going to b
chosen for deletion?

Thanks

--
Craz
-----------------------------------------------------------------------
Crazy's Profile: http://www.excelforum.com/member.php...nfo&userid=825
View this thread: http://www.excelforum.com/showthread.php?threadid=38260

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 709
Default Confirming a deletion

Crazy, try this,

Sub delete_row()

Msg = "Do Your Want To Delete Row " & ActiveCell.Row & " ?"
Title = "Delete Row ?"
Response = MsgBox(Msg, vbYesNo + vbQuestion, Title)

If Response = vbNo Then
Exit Sub ' Quit the macro
End If

ActiveCell.EntireRow.Delete

End Sub


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

"Crazy" wrote in
message ...

Hi,
I am very new to writing Macro's, etc, so hopefully this will be an
easy question for all you experts!

I have a spreadsheet with several rows of data, that occassionally, a
single row will need to be deleted from. I want a confirmation message
to come up when the row is selected for deletion with something like
"Are you sure you want to delete?"

Can this be done without knowing exactly which row is going to be
chosen for deletion?

Thanks!


--
Crazy
------------------------------------------------------------------------
Crazy's Profile:

http://www.excelforum.com/member.php...fo&userid=8251
View this thread: http://www.excelforum.com/showthread...hreadid=382603



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
Confirming Vlues in 2 Cells Appear in a List Jamie M Excel Worksheet Functions 2 March 11th 06 02:14 PM
Macro for Confirming Delete COG Excel Programming 7 July 3rd 04 05:51 PM
Confirming existence of dependents Mike[_65_] Excel Programming 4 January 14th 04 12:25 AM
Confirming existence of dependents Mike[_65_] Excel Programming 0 January 12th 04 09:11 AM
Confirming existence of dependents Mike[_65_] Excel Programming 0 January 11th 04 02:50 PM


All times are GMT +1. The time now is 03:20 AM.

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

About Us

"It's about Microsoft Excel"