+ Reply to Thread
Results 1 to 5 of 5

using if statement to save worksheets if they exist

  1. #1
    Registered User
    Join Date
    01-09-2012
    Location
    here
    MS-Off Ver
    Excel 2003
    Posts
    68

    using if statement to save worksheets if they exist

    I'm trying to save worksheets as a .prn file. the issue is some days the one one sheet may not exist and i get an error to save so the macro will stop completly instead of saving the ne worksheet. is there a way i can use an if statement to save the worksheets if it exist?
    Last edited by daillest319; 06-20-2012 at 09:52 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    08-29-2011
    Location
    Mississauga, CANADA
    MS-Off Ver
    Excel 2010
    Posts
    503

    Re: using if statement to save worksheets if they exist

    Try this:

    Please Login or Register  to view this content.
    Regards,
    Khaled Elshaer
    www.BIMcentre.com

    Remember To Do the Following....
    1. Thank those who have helped you by clicking the Star below their post.
    2. Mark your post SOLVED if it has been answered satisfactorily:
    • Select Thread Tools (on top of your 1st post)
    • Select Mark this thread as Solved

  3. #3
    Registered User
    Join Date
    01-09-2012
    Location
    here
    MS-Off Ver
    Excel 2003
    Posts
    68

    Re: using if statement to save worksheets if they exist

    i did the following but it doesn't work and it highlights nothing and says invalid use of object....am i missing something?



    Please Login or Register  to view this content.

  4. #4
    Valued Forum Contributor
    Join Date
    08-29-2011
    Location
    Mississauga, CANADA
    MS-Off Ver
    Excel 2010
    Posts
    503

    Re: using if statement to save worksheets if they exist

    Try this

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    01-09-2012
    Location
    here
    MS-Off Ver
    Excel 2003
    Posts
    68

    Re: using if statement to save worksheets if they exist

    Thanks worked perfect

+ 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