+ Reply to Thread
Results 1 to 3 of 3

How do I select a range to print if I have different numbers of ro

  1. #1
    Charles Bennington
    Guest

    How do I select a range to print if I have different numbers of ro

    The difficulty I am having is because I could use select current region but I
    have one column that includes a IF formula that returns a zero even if other
    cells in the row are blank. Accordingly select current region includes all
    the rows with zero values from the IF statement

  2. #2
    Shawn O'Donnell
    Guest

    RE: How do I select a range to print if I have different numbers of ro

    "Charles Bennington" wrote:
    > The difficulty I am having is because I could use select current region but I
    > have one column that includes a IF formula that returns a zero even if other
    > cells in the row are blank. Accordingly select current region includes all
    > the rows with zero values from the IF statement


    Two options for you to consider:

    1. change the IF statement so that it returns "" instead of 0. If 0 can be
    a valid answer for non-empty rows, however, that won't work.

    2. Nest your IF statement inside another IF statement. The outer IF tests
    enough of the other columns to tell if it should execute the inner IF or give
    up and display nothing.

    That is, if it was enough to know if column A is empty, then

    =IF( A2 <>"", IF([your original IF statement]), "" )


  3. #3
    Charles Bennington
    Guest

    RE: How do I select a range to print if I have different numbers o

    Thanks Shawn - in the end I used the following approach (found elsewhere on
    the discussion groups). The problem I was having is that the use of double
    double quotes(!) returns a zero in the cell meaning the print rang was
    including lots of rows with only a zero to print!

    Range("A65536").Select
    Selection.End(xlUp).Select
    intLastRow = ActiveCell.Row
    ActiveSheet.PageSetup.PrintArea = "$A$1:$L$" & intLastRow
    ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True

    Thanks for the help

    "Shawn O'Donnell" wrote:

    > "Charles Bennington" wrote:
    > > The difficulty I am having is because I could use select current region but I
    > > have one column that includes a IF formula that returns a zero even if other
    > > cells in the row are blank. Accordingly select current region includes all
    > > the rows with zero values from the IF statement

    >
    > Two options for you to consider:
    >
    > 1. change the IF statement so that it returns "" instead of 0. If 0 can be
    > a valid answer for non-empty rows, however, that won't work.
    >
    > 2. Nest your IF statement inside another IF statement. The outer IF tests
    > enough of the other columns to tell if it should execute the inner IF or give
    > up and display nothing.
    >
    > That is, if it was enough to know if column A is empty, then
    >
    > =IF( A2 <>"", IF([your original IF statement]), "" )
    >


+ 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