+ Reply to Thread
Results 1 to 6 of 6

On Error Problem...

  1. #1
    Forum Contributor
    Join Date
    07-02-2006
    Location
    Love City, USA
    Posts
    183

    Question On Error Problem...

    Hi,

    I am trying to adapt an input box that will create a new Worksheet, and assign
    the new sheet the name put in the input box.. That works ok, but I am
    trying to MessageBox an Error if the Worksheet name already exists before
    it creates the new worksheet.

    The code I am presenting partially works;
    It will Message Box the Error even if the Worksheet name doesn't exist.
    And It creates the new sheet regardless..

    Could someone show me any corrections to fix the problems I am getting with
    This Code.. Thanks For Any Help On This..

    HTML Code: 
    Last edited by Mhz; 03-28-2007 at 01:30 PM.
    Megahertz

  2. #2
    Valued Forum Contributor
    Join Date
    12-16-2004
    Location
    Canada, Quebec
    Posts
    363
    Hi

    I would try something like this
    Please Login or Register  to view this content.
    Denis

    Please always attach the sample workbook without sensitive information when asking for help

    To add a module
    Press Alt + F11 (this is the Visual Basic Environment)
    Insert Menu, select Module
    Past code there
    Close Visual Basic Environment (X)

  3. #3
    Forum Contributor
    Join Date
    07-02-2006
    Location
    Love City, USA
    Posts
    183
    Hi Jetted,

    That one is not working for me.. I get no response on error, nor does a new
    sheet get created. Thanks for the input..

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Maybe this will help.

    It use a seperate function to check if sheet exists

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  5. #5
    Forum Contributor
    Join Date
    07-02-2006
    Location
    Love City, USA
    Posts
    183

    Thumbs up WORKS GREAT! Thanks..

    Yes VBAnoob, That works out good for me now.. I modified the new sheet
    with my copy functions and its working error free .. THNAKS ALOT! ..

  6. #6
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Glad it helped

    VBA Noob

+ 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