+ Reply to Thread
Results 1 to 2 of 2

error trapping for sheet rename

  1. #1
    Registered User
    Join Date
    04-05-2009
    Location
    Brisbane, Australia
    MS-Off Ver
    Office 365
    Posts
    71

    error trapping for sheet rename

    Hi there,

    I am using a VBA macro to rename a set of sheets in a workbook.

    Please Login or Register  to view this content.
    No issues there. However, if one or more of the sheets have been removed from the workbook I would like the macro to skip over the missing sheet and continue to the next sheet as there are a total of 30 sheets this macro renames at any given time.

    Any help would be greatly appreciated.



    Thanks in advance,
    Chris
    Last edited by Xtopher; 05-21-2013 at 11:35 PM.
    Regards,
    Xtopher

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: error trapping for sheet rename

    Hi, Chris ,

    you could either use
    Please Login or Register  to view this content.
    what would continue with the code no matter what error shows up (maybe leading to unwanted results in Variables) or use a function to determine whether a sheet exists like
    Please Login or Register  to view this content.
    to be called
    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

+ 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