+ Reply to Thread
Results 1 to 5 of 5

Print pages according to cell value excel vba

  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 excel vba

    hi,
    i have a code to print out sheet from 1 page to range c1.value
    if c1.value = 2 then it will print page from 1 to 2
    if c1.value = 5 then it will print page from 1 to 5
    if c1.value = 7 then it will print page from 1 to 7
    Please Login or Register  to view this content.
    now i have having a problem here after successfully applied above code now i want to start printout from column(P) instead of Column(b)

    thank you
    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 Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Print pages according to cell value excel vba

    For that you need to set your Print Area. Read up on that.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    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 excel vba

    thank admin for reply
    actually i want to trying like this
    Please Login or Register  to view this content.
    i want to start FROM page 10 TO ws.range("h1").value

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Print pages according to cell value excel vba

    That syntax looks correct for that requirement.

  5. #5
    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 excel vba

    oops!
    yes you are right
    i added just OnErrorResumeNext

    Please Login or Register  to view this content.
    and its working now
    thank you

+ 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. Need vba code to print specific pages or all pages in a multipage UserForm
    By Pimp_mentality in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-24-2020, 08:13 PM
  2. [SOLVED] Print pages according to cell value from all workbook
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 03-02-2017, 05:51 AM
  3. Replies: 1
    Last Post: 03-24-2016, 05:28 PM
  4. Replies: 6
    Last Post: 05-03-2013, 09:52 AM
  5. print pages based on number in cell
    By lpratt in forum Excel General
    Replies: 3
    Last Post: 01-10-2012, 08:08 PM
  6. Replies: 1
    Last Post: 06-14-2006, 06:50 AM
  7. [SOLVED] Sequencing a Cell over print pages
    By Benjamin in forum Excel General
    Replies: 0
    Last Post: 02-08-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