+ Reply to Thread
Results 1 to 17 of 17

Print pages according to cell value from all workbook

  1. #1
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,080

    Print pages according to cell value from all workbook

    hi,

    i am using below code to print a sheet according to cell value
    but
    i want to apply this code to all of my sheets except two sheets ("of") and ("of2")

    thank you

    Please Login or Register  to view this content.
    Use Code-Tags for showing your code :
    Please mark your question Solved if there has been offered a solution that works fine for you
    If You like solutions provided by anyone, feel free to add reputation using STAR *

  2. #2
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,080

    Re: Print pages according to cell value from all workbook

    I found this code but its saying Method printout object worksheet failed

    Please Login or Register  to view this content.
    Capture.JPG

  3. #3
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,914

    Re: Print pages according to cell value from all workbook

    In your first code you refer to Range("N3"), in your second code Range("N1"). Which is correct ?
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  4. #4
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,080

    Re: Print pages according to cell value from all workbook

    Sorry for that mistake

    N1 IS CORRECT

  5. #5
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,914

    Re: Print pages according to cell value from all workbook

    What's in N1 ? A value, a formula ?
    Are there more than 2 sheets present ?
    It's just because when I fill N1 with a value your code just works fine.

  6. #6
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,080

    Re: Print pages according to cell value from all workbook

    N1 = FORMULA

    There is no limit of sheets

  7. #7
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,080

    Re: Print pages according to cell value from all workbook

    sheets generate according to my need?

    yes there is more then two sheets presents

  8. #8
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,914

    Re: Print pages according to cell value from all workbook

    The only thing I can come up with is that the formula errors out on some page or another because for the rest your code is perfectly fine.
    Also in your 1st post you talk about sheets of & of2, in your last code there's haroon & OF. maybe there's an error somewhere ?

  9. #9
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,080

    Re: Print pages according to cell value from all workbook

    Thank you for the reply

    actually i want to skip two sheets with any name

  10. #10
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,914

    Re: Print pages according to cell value from all workbook

    I'll have to see the file that produces the error because I'm out of options.

  11. #11
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,080

    Re: Print pages according to cell value from all workbook

    Here is workbook
    Attached Files Attached Files

  12. #12
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,914

    Re: Print pages according to cell value from all workbook

    The problem is a hidden sheet named BAL.

  13. #13
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,080

    Re: Print pages according to cell value from all workbook

    oh!

    not what to do ?

  14. #14
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,080

    Re: Print pages according to cell value from all workbook

    Because i don't want to show that sheet

  15. #15
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,914

    Re: Print pages according to cell value from all workbook

    Come on HaroonSid, this was an easy one even for you.

    Please Login or Register  to view this content.

  16. #16
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,080

    Re: Print pages according to cell value from all workbook

    Very very thank you Mr. bakerman2

    works perfect

  17. #17
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,914

    Re: Print pages according to cell value from all workbook

    You're very, very welcome and thanks for rep+.

+ 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. Replies: 2
    Last Post: 08-29-2016, 01:36 PM
  2. Replies: 1
    Last Post: 03-24-2016, 05:28 PM
  3. Replies: 0
    Last Post: 01-21-2013, 07:56 PM
  4. [SOLVED] Should all pages in a workbook print in color?
    By Billy in forum Excel General
    Replies: 12
    Last Post: 04-07-2009, 03:30 AM
  5. Replies: 1
    Last Post: 02-28-2006, 02:45 PM
  6. [SOLVED] HOW DO I PRINT ALL PAGES AT ONCE IN A WORKBOOK THAT HAS ABOUT 20 .
    By HASZIE in forum Excel General
    Replies: 1
    Last Post: 04-13-2005, 01:06 PM
  7. [SOLVED] How to print a worksheet but number the pages by workbook
    By Frank Clayton in forum Excel General
    Replies: 2
    Last Post: 01-10-2005, 07:06 PM

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