Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Warning Statement to Delete Macro

Hello,

I want to create a delete row macro button in a
spreadsheet for several users and want to add a warning
comment such as "Are you sure you want to delete this
row?". I do not know VB very well. Can someone help me
with this code? Thanks.

John
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 73
Default Warning Statement to Delete Macro

John, how about something like this, assign it to a button on your sheet

Sub test()
Msg = "Are You Sure You Want To Delete Row 2 ?"
Title = "Continue ?"
Response = MsgBox(Msg, vbYesNoCancel + vbQuestion, Title)

If Response = vbNo Then
Exit Sub
End If

If Response = vbCancel Then
Exit Sub
End If
Rows("2:2").Delete Shift:=xlUp

End Sub

--
Paul B
Always backup your data before trying something new
Using Excel 97 & 2000
Please post any response to the newsgroups so others can benefit from it
** remove news from my email address to reply by email **

"John M" wrote in message
...
Hello,

I want to create a delete row macro button in a
spreadsheet for several users and want to add a warning
comment such as "Are you sure you want to delete this
row?". I do not know VB very well. Can someone help me
with this code? Thanks.

John



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
Macro warning - how to delete macro GavinS Excel Worksheet Functions 3 April 1st 09 01:45 PM
using VBA how can I delete a worksheet w/o the warning message pop Jim K.[_2_] Excel Discussion (Misc queries) 2 July 1st 08 04:00 PM
Why security warning still appear after I delete all macros Wei Kai Excel Worksheet Functions 1 February 8th 07 05:51 AM
What is the VBA code to delete a sheet without warning message? [email protected] Excel Discussion (Misc queries) 2 August 9th 05 04:16 PM
Can I add a Warning Meassage to a Macros Designed to Delete a Row C Bonovich Excel Worksheet Functions 1 June 2nd 05 07:32 AM


All times are GMT +1. The time now is 01:32 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"