+ Reply to Thread
Results 1 to 8 of 8

Clear button, add warning dialogue box that asks: Are you sure you want to clear?

Hybrid View

nenadmail Clear button, add warning... 05-21-2012, 10:39 AM
JapanDave Re: Clear button, add warning... 05-21-2012, 10:41 AM
nenadmail Re: Clear button, add warning... 05-21-2012, 10:51 AM
AlvaroSiza Re: Clear button, add warning... 05-21-2012, 10:44 AM
nenadmail Re: Clear button, add warning... 05-21-2012, 01:35 PM
AlvaroSiza Re: Clear button, add warning... 05-21-2012, 02:13 PM
nenadmail Re: Clear button, add warning... 05-21-2012, 02:41 PM
JapanDave Re: Clear button, add warning... 05-21-2012, 10:53 AM
  1. #1
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Clear button, add warning dialogue box that asks: Are you sure you want to clear?

    For your original code.

    Sub Clear()
    
    Dim c02
    '
    ' Clear Macro
    '
    
    '
        c02 = MsgBox("Are you sure you want to clear?", vbYesNo, "Clear")
           If c02 = vbYes Then
              Range("C7:E91").ClearContents
           End If
    End Sub
    Last edited by JapanDave; 05-21-2012 at 10:55 AM. Reason: Left out code
    Be fore warned, I regularly post drunk. So don't take offence (too much) to what I say.
    I am the real 'Napster'
    The Grid. A digital frontier. I tried to picture clusters of information as they moved through the computer. What did they look like? Ships? motorcycles? Were the circuits like freeways? I kept dreaming of a world I thought I'd never see. And then, one day...

    If you receive help please give thanks. Click the * in the bottom left hand corner.

    snb's VBA Help Files

  2. #2
    Forum Contributor
    Join Date
    05-19-2012
    Location
    Croatia
    MS-Off Ver
    Excel 2007
    Posts
    200

    Re: Clear button, add warning dialogue box that asks: Are you sure you want to clear?

    Thanks.... but when I click "Cancel"
    It still clears away the data.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1