Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Average of select range of numbers W Palermo Excel Worksheet Functions 2 June 11th 08 03:30 AM
How to select top six numbers from a of range of random numbers Jack M Taylor Excel Worksheet Functions 4 January 30th 07 09:18 PM
Randomly select numbers from a range Fred Smith Excel Discussion (Misc queries) 15 October 3rd 06 02:01 AM
formula to select numbers from a range mark (plymouth) Excel Worksheet Functions 1 February 14th 06 05:09 PM
My First User Form - How to Select Range(s) and Print Bruce Roberson[_2_] Excel Programming 3 July 25th 03 03:09 AM


All times are GMT +1. The time now is 12:31 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"