+ Reply to Thread
Results 1 to 7 of 7

Print Selection Macro help

  1. #1
    Registered User
    Join Date
    01-17-2020
    Location
    Corvallis, OR
    MS-Off Ver
    2019
    Posts
    33

    Print Selection Macro help

    so what I am doing is trying to get a certain selection to print after something is entered into a box. I have tried a couple different variations and have come to this one:
    Please Login or Register  to view this content.
    This kind of does what I want it to do to a point but I need it to print ONLY if G13 turns green(I already have the formula set up for this) and also to print on 1 page (currently F15-F17 print on 1 page and G15-G17 print on a second page)


    Any help would be much appreciated.
    Attached Files Attached Files
    Last edited by Jede; 02-14-2020 at 12:57 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    01-14-2013
    Location
    Austria
    MS-Off Ver
    2016 / 2019
    Posts
    339

    Re: Print Selection Macro help

    if you want to do it automatically you have to use this worksheet event

    Please Login or Register  to view this content.
    If you do it manually then
    Please Login or Register  to view this content.
    cheers

  3. #3
    Registered User
    Join Date
    01-17-2020
    Location
    Corvallis, OR
    MS-Off Ver
    2019
    Posts
    33

    Re: Print Selection Macro help

    I am not sure if I am inputting these incorrectly or not but neither of these work properly. The Automatic one does not print unless you run the macro via the VBE. The Manual one does print the selection but still prints them both on separate pages(I need them on the same page as if printing a page that only has those items on it.

  4. #4
    Valued Forum Contributor
    Join Date
    01-14-2013
    Location
    Austria
    MS-Off Ver
    2016 / 2019
    Posts
    339

    Re: Print Selection Macro help

    My error

    Worksheet_ChangeSelection is the wrong event --> must be Worksheet_Change
    I do not understand why you cannot use
    Range("F15:G17") instead of Range("F15:F17,G15:G17")

    in the case the are really separated then union() must be used and a printarea must be set

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

  5. #5
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,498

    Re: Print Selection Macro help

    Is there a specific reason why you use
    Please Login or Register  to view this content.
    instead of
    Please Login or Register  to view this content.
    The latter will print to a single page.
    If the thought is that you might want to print non adjacent areas, you might need something like
    Please Login or Register  to view this content.
    If you want to print A10:A15 and H10:H15 on a single page.

  6. #6
    Registered User
    Join Date
    01-17-2020
    Location
    Corvallis, OR
    MS-Off Ver
    2019
    Posts
    33

    Re: Print Selection Macro help

    Basically the use is going to be a label for an inventory process. So I only need those 6 cells to print as that's about the size of the label. I am still a newbie when it comes to the scripting side of Excel so I wasn't sure of the proper format to get only those 6 to print.

  7. #7
    Registered User
    Join Date
    01-17-2020
    Location
    Corvallis, OR
    MS-Off Ver
    2019
    Posts
    33

    Re: Print Selection Macro help

    Thank you Gue your response works great!

+ 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. Macro To Print Selection In Color + Landscape
    By djsouljah in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-23-2013, 10:54 PM
  2. Print a certain selection macro
    By mmcgrail in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-17-2013, 10:11 AM
  3. A macro to force print selection to PDF
    By Clydie in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-17-2013, 09:32 PM
  4. Macro to print a variable selection
    By galegai in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-28-2013, 10:03 PM
  5. Macro to Print Selection
    By Jiptastic in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-27-2012, 04:49 PM
  6. Macro to Print Selection
    By luke_p in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-21-2008, 12:19 PM
  7. Date, Cell Selection and Print Macro - Possible?
    By EinGutesBier in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-03-2008, 12:55 PM
  8. [SOLVED] How do I print a selection of cells using a macro?
    By gussuffert in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-04-2005, 05: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