+ Reply to Thread
Results 1 to 6 of 6

Delete Work Sheet and swap the name

  1. #1
    Registered User
    Join Date
    06-28-2022
    Location
    KSA
    MS-Off Ver
    Microsoft Office Professional Plus 2019
    Posts
    39

    Lightbulb Delete Work Sheet and swap the name

    Hello All

    I need to delete the Active worksheet and use its name in other worksheet called "Temp Sheet", finally the "Temp Sheet" will be the active one and its name will be changed to the deleted one name.

    I am using the following code to delete the active sheet so i need to keep his name to use it in replacement of the "Temp Sheet" Worksheet

    The active Worksheet want to be deleted is always variable name.

    Please Login or Register  to view this content.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    43,732

    Re: Delete Work Sheet and swap the name

    Untested

    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    06-28-2022
    Location
    KSA
    MS-Off Ver
    Microsoft Office Professional Plus 2019
    Posts
    39

    Re: Delete Work Sheet and swap the name

    TMS Thanks for your fast reply

    Its deleting the cell but not rename the "Temp Sheet" to the new name its only popup a box with the new name.

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    43,732

    Re: Delete Work Sheet and swap the name

    You need to combine this with the solution to your last question. I'm not quite sure what you are trying to achieve. The MsgBox was just to demonstrate the name had been saved to a variable. Just use that to name whatever sheet you want.

  5. #5
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    365 32bit Win
    Posts
    1,638

    Re: Delete Work Sheet and swap the name

    Does this work for you?

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    06-28-2022
    Location
    KSA
    MS-Off Ver
    Microsoft Office Professional Plus 2019
    Posts
    39

    Re: Delete Work Sheet and swap the name

    Its working perfectly thanks ByteMarks and TMS

+ 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. Vba code to disable delete option of sheet doesn't work in M365
    By iustin in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-06-2021, 05:10 AM
  2. Make a sheet where i can swap out tables using for instance a list
    By The excel apprentice in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 03-18-2016, 11:49 AM
  3. Sheet swap macro stops swapping after period of time, where is the problem?
    By lazlow89 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-02-2016, 06:15 AM
  4. Replies: 3
    Last Post: 11-29-2015, 09:33 PM
  5. [SOLVED] Delete all the Rows on Work sheet using three week parameter
    By kesavanprabhu in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-05-2013, 08:44 AM
  6. Replies: 3
    Last Post: 02-22-2013, 11:28 AM
  7. Replies: 4
    Last Post: 06-15-2011, 09:33 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