+ Reply to Thread
Results 1 to 8 of 8

Print area changing with input

  1. #1
    Registered User
    Join Date
    09-25-2007
    Posts
    11

    Print area changing with input

    I have a sheet that I would like the print area to change vertically based upon user input from (2) different cells. I have attached the sheet with the basic print macro in it, but I don't know how to return the data from the user input to adjust the print area.

    Any help would be greatly appreciated.
    Attached Files Attached Files

  2. #2
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161
    Hi, i haven't looked at your example but to set a print area by putting cell addresses in seperate cells you can use the code below:
    Please Login or Register  to view this content.
    Not all forums are the same - seek and you shall find

  3. #3
    Registered User
    Join Date
    09-25-2007
    Posts
    11
    Simon:

    Thanks for the reply. I'm one step closer.

    In my example I am trying to get the print area to change vertically depending upon input from cells AB2 and AB3. I would like the print area to print from column J to column AB always, but adjust vertically by looking at column K based upon input from cells AB2 and AB3. Some dates in column K are repeated, so it would need to look for the first instance and the last instance.

    I apologize if I can't explain it thorough enough. It probably is easier to understand when looking at the example.

    Thanks,

    Randy

  4. #4
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161
    How about something like this:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    09-25-2007
    Posts
    11
    Thanks Simon, the filtering portion works great, vertically. I have been making spreadsheets for years, but have not dabbled into the macro portion of it (other than recording one). I am just starting to get a drift on some of the commands. This filter works great. Now I just need to know how to combine this with fixing the print area horizontally at columns "J" & "AB" and then set the print area to all of those parameters.


    Please Login or Register  to view this content.
    Thank you.
    Last edited by Simon Lloyd; 10-07-2007 at 09:28 AM.

  6. #6
    Registered User
    Join Date
    09-25-2007
    Posts
    11
    I went to Rule #5, not sure how to show the tags. I did however attach the updated sheet with the macro in it.

    Thanks.
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    09-09-2005
    Location
    England
    MS-Off Ver
    2007
    Posts
    1,500
    Not an elegant solution but the following works if both the dates exist

    Regards

    Note I have put in print preview, you can change it to the other line below when you are happy it works

    Dav
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    09-25-2007
    Posts
    11
    Thanks Dav...

    I've been gone for almost a week. Your fix gets the job done. Good thinking.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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