+ Reply to Thread
Results 1 to 4 of 4

CommandButton Macro to print pages on another sheet based on cell contents

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    10-03-2016
    Location
    Sydney, Australia
    MS-Off Ver
    MS 365
    Posts
    128

    CommandButton Macro to print pages on another sheet based on cell contents

    Hi,

    Is there a macro for a commandbutton to print pages from another sheet based on the contents of cells?

    If there is, I don't want the normal print box to appear, I'd like the button to automatically start printing the pages.


    I have one sheet where I enter all the data manually. This is the page the commandbutton will be on, but the pages that will be printed are on a separate page.

    The data is then transferred onto another sheet (that will be hidden from other staff) already set up to specific page size, layout and print area. Outside the print area will be cells containing the "print from", "print to" and "number of copies" numbers that the commandbutton will need to be linked to.

    Hopefully this makes sense and is possible. I've attached a mock up of what I'd like.

    Thanks
    Adam
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    07-10-2012
    Location
    Bangladesh
    MS-Off Ver
    Excel 2007
    Posts
    129

    Re: CommandButton Macro to print pages on another sheet based on cell contents

    check i have attached one file

    please use the same and follow instruction

    regards

    cheers
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    10-03-2016
    Location
    Sydney, Australia
    MS-Off Ver
    MS 365
    Posts
    128

    Re: CommandButton Macro to print pages on another sheet based on cell contents

    Hi Morevijay,

    That's brilliant! Had to configure the measurements but it appears to be working.

    There's only one sheet that I want to print (Sheet2), this sheet would be hidden as no one will need to use it. All the data would be in another sheet (Sheet1) and on this page is where I want the button.

    Is there a way so that when I click the button on Sheet1, only the pages from Sheet2 print?

    Basically I want the exact set up as you have generously provided, I just want the actual print button for Sheet2 installed on Sheet1 instead.

  4. #4
    Forum Contributor
    Join Date
    07-10-2012
    Location
    Bangladesh
    MS-Off Ver
    Excel 2007
    Posts
    129

    Re: CommandButton Macro to print pages on another sheet based on cell contents

    Check sheet 1

    as excel restrcit that print or printpreview should be which sheet is you are viewing

    as you can choose record for print by adding record no to cell dp4 and upto in cell dr4
    Attached Files Attached Files

+ 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. Print Pages Based On Cell
    By Anarchus in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-26-2017, 01:21 AM
  2. Print Macro for multiple but different print pages of the same sheet
    By dgarrod in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-18-2017, 02:55 PM
  3. Edit print macro to be based on number of pages in Sheet
    By KT999 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-06-2014, 10:25 AM
  4. [SOLVED] Trying to build Macro that would print based on contents of cell
    By arndtb in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-28-2013, 04:48 PM
  5. Print pages based on time in cell.
    By Macfool in forum Excel General
    Replies: 0
    Last Post: 07-11-2012, 01:25 PM
  6. [SOLVED] Macro to print number of pages based on cell
    By Webbers in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-24-2012, 02:15 PM
  7. print pages based on number in cell
    By lpratt in forum Excel General
    Replies: 3
    Last Post: 01-10-2012, 08:08 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