+ Reply to Thread
Results 1 to 5 of 5

Code to select "Delete" when deleting a tab within a Macro

  1. #1
    Forum Contributor
    Join Date
    08-08-2015
    Location
    NJ
    MS-Off Ver
    2013
    Posts
    205

    Code to select "Delete" when deleting a tab within a Macro

    Hello, is there a way to delete a tab during a macro? In the attached sample for example, when a tab is deleted via code, the message box pops up despite clicking the "delete" button while recording the macro. Is there a way to code the delete button being selected so the macro is not interrupted with the message box?

    Thanks so much.
    Sheryl

  2. #2
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: Code to select "Delete" when deleting a tab within a Macro

    Hello,

    Here's how to do it :

    Please Login or Register  to view this content.
    GC Excel

    If this post helps, then click the star icon (*) in the bottom left-hand corner of my post to Add reputation.

  3. #3
    Valued Forum Contributor
    Join Date
    06-29-2014
    Location
    Australia
    MS-Off Ver
    MSO 365
    Posts
    1,098

    Re: Code to select "Delete" when deleting a tab within a Macro

    Hello Sheryl,

    If you are referring to the warning message that pops up asking you to confirm whether or not you wish to proceed with the sheet deletion, then you would only need to modify the code as follows:-


    Please Login or Register  to view this content.
    This will suppress the pop up.

    I hope that this helps.

    Cheerio,
    vcoolio.

  4. #4
    Forum Contributor
    Join Date
    08-08-2015
    Location
    NJ
    MS-Off Ver
    2013
    Posts
    205

    Re: Code to select "Delete" when deleting a tab within a Macro

    Thank you!

  5. #5
    Valued Forum Contributor
    Join Date
    06-29-2014
    Location
    Australia
    MS-Off Ver
    MSO 365
    Posts
    1,098

    Re: Code to select "Delete" when deleting a tab within a Macro

    You're welcome Sheryl,

    Glad that we were able to help and thanks for the rep.

    Cheerio,
    vcoolio.

+ 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] Code Clean-Up: Delete "False" worksheet created when "Cancel" is chosen in Input Box
    By Kenny Blackwell in forum Excel Programming / VBA / Macros
    Replies: 25
    Last Post: 08-31-2015, 10:00 AM
  2. [SOLVED] Code that copies row of data to another sheet based on text "Complete"/"Delete"
    By Dremzy in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 04-20-2014, 05:51 PM
  3. Replies: 2
    Last Post: 04-20-2014, 11:18 AM
  4. "Form and macro" to delete "Active" cell contents.
    By wanty in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-22-2013, 11:33 PM
  5. Help adding VBA code to existing macro to select "today's" date
    By kennected in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-18-2012, 09:21 PM
  6. Have vba code, trying to get the macro to select the "current date" tab and paste
    By msu4life in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-11-2012, 02:35 PM
  7. VBA Code for deleting rows where cell in column a states "delete row"
    By tnfire in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-20-2009, 06:17 PM

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