+ Reply to Thread
Results 1 to 5 of 5

"Are You Sure" message

  1. #1
    Registered User
    Join Date
    07-24-2015
    Location
    Fairhope, AL, United States
    MS-Off Ver
    16.35 (Office 365)
    Posts
    40

    "Are You Sure" message

    I have recorded a macro to clear contents of selected ranges of cells in a worksheet and assigned it to a radio button. It works perfectly but once pressing the radio button and initiating the macro there is no turning back. I would like to insert a warning message, such as "Are you sure?", to have to be agreed to in order for the macro to proceed. Any suggestions?

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: "Are You Sure" message

    Please Login or Register  to view this content.
    Last edited by shg; 08-04-2015 at 09:59 AM.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    07-24-2015
    Location
    Fairhope, AL, United States
    MS-Off Ver
    16.35 (Office 365)
    Posts
    40

    Re: "Are You Sure" message

    Here is the recorded macro. I had to record it as I am lacking in VBA skills.

    Sub DelResults()
    '
    ' DelResults Macro
    ' Clear contents
    '
    ' Keyboard Shortcut: Option+Cmd+x
    '

    Range("D6:E22").Select
    Selection.ClearContents
    Range("F23:I23").Select
    Selection.ClearContents
    Range("D27:E43").Select
    Selection.ClearContents
    Range("F44:I44").Select
    Selection.ClearContents
    ActiveWindow.SmallScroll Down:=26
    Range("D48:E64").Select
    Selection.ClearContents
    Range("F65:I65").Select
    Selection.ClearContents
    ActiveWindow.SmallScroll Down:=32
    Range("D69:E85").Select
    Selection.ClearContents
    Range("F86:I86").Select
    Selection.ClearContents
    Range("D90:E106").Select
    Selection.ClearContents
    Range("F107:I107").Select
    Selection.ClearContents
    ActiveWindow.SmallScroll Down:=42
    Range("D111:E127").Select
    Selection.ClearContents
    Range("F128:I128").Select
    Selection.ClearContents
    Range("D132:E148").Select
    Selection.ClearContents
    Range("F149:I149").Select
    Selection.ClearContents
    ActiveWindow.SmallScroll Down:=23
    Range("D153:E169").Select
    Selection.ClearContents
    Range("F170:I170").Select
    Selection.ClearContents
    ActiveWindow.SmallScroll Down:=25
    Range("D174:E190").Select
    Selection.ClearContents
    Range("F191:I191").Select
    Selection.ClearContents
    ActiveWindow.SmallScroll Down:=17
    Range("D195:E211").Select
    Selection.ClearContents
    Range("F212:I212").Select
    Selection.ClearContents
    ActiveWindow.SmallScroll Down:=37
    Range("D216:E232").Select
    Selection.ClearContents
    Range("F233:I233").Select
    Selection.ClearContents
    Range("D237:E253").Select
    Selection.ClearContents
    Range("F254:I254").Select
    Selection.ClearContents
    ActiveWindow.SmallScroll Down:=23
    Range("D258:E274").Select
    Selection.ClearContents
    Range("F275:I275").Select
    Selection.ClearContents
    ActiveWindow.SmallScroll Down:=25
    Range("D279:E295").Select
    Selection.ClearContents
    Range("F296:I296").Select
    Selection.ClearContents
    ActiveWindow.SmallScroll Down:=23
    Range("D300:E316").Select
    Selection.ClearContents
    Range("F317:I317").Select
    Selection.ClearContents
    ActiveWindow.SmallScroll Down:=29
    Range("D321:E337").Select
    Selection.ClearContents
    Range("F338:I338").Select
    Selection.ClearContents
    ActiveWindow.SmallScroll Down:=-441
    Range("A8").Select

    End Sub

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: "Are You Sure" message

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    07-24-2015
    Location
    Fairhope, AL, United States
    MS-Off Ver
    16.35 (Office 365)
    Posts
    40

    Re: "Are You Sure" message

    Thanks so much. I'm learning.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] IF a column contains anything other than "" then display the message "MISSING"
    By Richard_Thornton in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-30-2014, 06:45 AM
  2. Replies: 4
    Last Post: 11-17-2013, 12:05 PM
  3. [SOLVED] How to USE """"" cells count """"" change font color
    By austin123456 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-09-2013, 06:14 AM
  4. Message Box when is cell text is "YES" or "NO" !
    By headgaar in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-09-2013, 05:57 PM
  5. MSoffice Outlook 2003 message to be saved in C dir with the file name "From" "Sent" "Sub"
    By shailendra0509 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-09-2012, 01:32 AM
  6. Replies: 5
    Last Post: 10-12-2010, 06:46 AM
  7. can i get the "message pane" underneath the "threads pane" instea
    By Rich Mcc in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-03-2006, 06:25 AM

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