+ Reply to Thread
Results 1 to 7 of 7

Set Print Area, Ignore Formulas

  1. #1
    Registered User
    Join Date
    09-03-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    8

    Set Print Area, Ignore Formulas

    I am looking for a VBA Macro that sets the print area on the active sheet from A1 to the last used cell (the number of columns and rows is not consistent) and ignores "" returned by formulas.

    Thoughts?

    Thanks!

  2. #2
    Valued Forum Contributor WasWodge's Avatar
    Join Date
    08-02-2010
    Location
    Hampshire,England
    MS-Off Ver
    Office 365 and Office 2010
    Posts
    882

    Re: Set Print Area, Ignore Formulas

    Not sure exactly what end result you are expecting but try...

    Please Login or Register  to view this content.
    If my solution worked (or not) please let me know. If your question is answered then please remember to mark it solved

    Computers are like air conditioners. They work fine until you start opening windows. ~Author Unknown

  3. #3
    Registered User
    Join Date
    09-03-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Set Print Area, Ignore Formulas

    Thanks for your response.

    This is great with the exception that it ignores any cell with a formula. Ideally, I would like it to include any cell with a formula that returns a value (including 0), but not a formula that returns a blank.

  4. #4
    Valued Forum Contributor WasWodge's Avatar
    Join Date
    08-02-2010
    Location
    Hampshire,England
    MS-Off Ver
    Office 365 and Office 2010
    Posts
    882

    Re: Set Print Area, Ignore Formulas

    See if either of the codes below give you what you require

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

  5. #5
    Registered User
    Join Date
    09-03-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Set Print Area, Ignore Formulas

    Both do exactly what I wanted. For this application, PArea2 works better.

    Thank you so much!

  6. #6
    Registered User
    Join Date
    09-03-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Set Print Area, Ignore Formulas

    Both do exactly what I wanted. For this application, PArea2 works better.

    Thank you so much!

  7. #7
    Valued Forum Contributor WasWodge's Avatar
    Join Date
    08-02-2010
    Location
    Hampshire,England
    MS-Off Ver
    Office 365 and Office 2010
    Posts
    882

    Re: Set Print Area, Ignore Formulas

    Quote Originally Posted by gerlingc View Post
    Both do exactly what I wanted. For this application, PArea2 works better.

    Thank you so much!
    Happy it helped (PArea3() was me doing overkill just in case)

+ 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