+ Reply to Thread
Results 1 to 2 of 2

Error handling with "out of range" error, need it for a simple code

  1. #1
    Registered User
    Join Date
    08-23-2014
    Location
    Boston
    MS-Off Ver
    2013
    Posts
    5

    Error handling with "out of range" error, need it for a simple code

    Hey,

    This simple code is giving me a headache. All I want to do is change any sheet on my workbook named "Sheet#" where # is any number, to "Sheet1". I also want to delete any sheets named Sheet1 beforehand.

    When I run the code I can't around the fact that if Sheet1 is out of range. Is there a way to error handle an out of range? I would like it to skip anything that's out of range and not stop the macro.

    And another note - is there a syntax I can use to circumvent this whole thing? Like "Sheet*"? The asterisk isn't working for me.



    Please Login or Register  to view this content.

    Thanks for your help!

    Edit - code put in code format. Anybody got an idea though?
    Last edited by T12ISC; 09-05-2014 at 10:48 AM.

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Error handling with "out of range" error, need it for a simple code

    Please wrap your code with code tags as per forum's rule 3.

+ 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. Error "Subscript out of range", cant seem to find where code is wrong
    By KeithMale in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-14-2013, 07:07 PM
  2. [SOLVED] trying to understand why a code is not working "error 9 subscript out off range"
    By cdafonseca in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-09-2013, 12:33 PM
  3. Macro Error with code "Range("A65536").End(xlUp).EntireRow.Insert"
    By lukasj13 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-30-2010, 08:48 PM
  4. Error handling: "Resume without Error"
    By firefly2k8 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-08-2010, 08:04 AM
  5. Error Handling to mitigate "Run Time Erorr 13 Type Mismatch"
    By ExcelMonkey in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-16-2005, 09:05 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