+ Reply to Thread
Results 1 to 2 of 2

Trying to make a macro to set and print areas based on checkbox inputs.

  1. #1
    Registered User
    Join Date
    03-28-2023
    Location
    Ontario, Canda
    MS-Off Ver
    2022
    Posts
    1

    Unhappy Trying to make a macro to set and print areas based on checkbox inputs.

    Hello All,

    Currently I am trying to write a macro for my job where a user form box pops up and with check boxes the user can select which pages to print, and prints them to an 11x17 page, landscape, while fitting the page to 1 sheet of paper. With consistent "block if without end if" errors,

    So far I have been kind of successful? (yes I know all the print ranges are the same, Just hadnt changed them yet)

    The main challenge is that all 4 "pages" are on the same excel sheet, and need to stay that way. My code is intended to go through, and, if the check box is selected, set the print area to the given range and print out that page. Ideally with a printout preview but that would not work for me.

    I was able to get a single sheet to work and print properly, but now once adding in the buttons for the next 3 sheets, it no longer is working for me.

    Fair warning I am new to VBA and just getting into it, so there is 100% dumb mistakes and over-complicated commands,

    If anyone has any ideas It would be greatly appreciated!

    (Not sure how y'all put the little boxes with code So i will just post it below)

    Please Login or Register  to view this content.
    Last edited by XRYXS; 03-28-2023 at 02:52 PM. Reason: Updated code.. still getting 'expected end with'

  2. #2
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,645

    Re: Trying to make a macro to set and print areas based on checkbox inputs.

    Hi there,

    Maybe just:

    Please Login or Register  to view this content.

    Hope this helps.

    Regards,

    Greg M

+ 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 Worksheet/Areas With Checked CheckBox Control
    By casom in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-01-2020, 12:38 PM
  2. Print two print areas on one via a macro, for a loop
    By Mathpi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-19-2018, 02:08 PM
  3. [SOLVED] Define 3 print areas, make a PDF, open and attach the PDF to Microsoft Outlook.
    By gnaske in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-07-2017, 04:03 AM
  4. [SOLVED] Loop through checkbox and inputs data based on which is checked
    By joe8904 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-14-2016, 09:51 AM
  5. Macro to print multiple print areas on one page.
    By morangeman in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-23-2015, 12:13 PM
  6. Help! Set Ranges Based on Print Areas in VBA?
    By amanda12345 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-23-2013, 05:52 PM
  7. Macro need to change print areas based on Populated rows
    By awaring in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-29-2010, 02:01 PM

Tags for this Thread

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