+ Reply to Thread
Results 1 to 4 of 4

Automatically set Dynamic Print Area through Macro/VBA

  1. #1
    Registered User
    Join Date
    09-05-2013
    Location
    Las Vegas
    MS-Off Ver
    Excel 2003
    Posts
    8

    Automatically set Dynamic Print Area through Macro/VBA

    I'm trying to make the worksheet called "Medications" have a dynamic print area. I've tried to edit the Print_Area through "Define Name," however, a problem with this is that it auto-deletes itself whenever anyone accesses Page Setup. Also, I notice that settings in the page setup (page orientation, scaling fitting pages wide X tall, etc.)

    I feel like the best option will be a Macro/VBA to manually correct these issues. I hope someone can help. I basically need these things to happen:
    1) On the "Medications" worksheet, the worksheet's print width should start from Column C and end at Column H.
    2) On the "Medications" worksheet, the worksheet's print height should adapt to the data. Meaning, if there's an entry in cell C12, the print area = C1:H12. If there's an entry in cell F20, the print area = C1:H20.
    3) "Front Page" should be in portrait, "Labs" should be in portrait, "Medications" should be in landscape, "Assessment Data" should be in portrait, and "Care Plan" should be in portrait. The Medications worksheet is the only worksheet that needs to have a dynamic print range. The others can stay static as they are.

    Please let me know if you have any suggestions.

    ThanksCare Plan Template.xlsx
    Last edited by stratloveslenny; 11-18-2014 at 02:00 AM.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,486

    Re: Automatically set Dynamic Print Area through Macro/VBA

    There is nothing in the attachment.

  3. #3
    Registered User
    Join Date
    09-05-2013
    Location
    Las Vegas
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Automatically set Dynamic Print Area through Macro/VBA

    Edited. Sorry about that!

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,486

    Re: Automatically set Dynamic Print Area through Macro/VBA

    Run this before you print.

    Please Login or Register  to view this content.

+ 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. [SOLVED] Create a print macro that would automatically select print area?
    By wastedwings in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 06:05 PM
  2. Create a print macro that would automatically select print area?
    By Ron de Bruin in forum Excel Formulas & Functions
    Replies: 35
    Last Post: 09-06-2005, 05:05 PM
  3. [SOLVED] Create a print macro that would automatically select print area?
    By Ron de Bruin in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-06-2005, 04:05 AM
  4. [SOLVED] Create a print macro that would automatically select print area?
    By wastedwings in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM
  5. [SOLVED] Create a print macro that would automatically select print area?
    By wastedwings in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-22-2005, 06:05 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