#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Printing

I have a 20 sheet bid. I want to print half of each sheet if cell I55 is 0 print range if not then go to the next sheet check cell I87 is 0 print, or go to the next sheet and so on. What am I missing? The first sheet only works.

If [I55] 0 The
Range("A52:I67").Selec
Selection.PrintOu
Els
If [I87] 0 The
Range("A84:I99").Selec
Selection.PrintOu
Els
If [I119] 0 The
Range("A116:I131").Selec
Selection.PrintOu
End I
End I
End I
End Su

Thank you for you help!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Printing

It seemed to work for me under light testing.

What happens when you step through the code?

And it looks like your data is laid out nicely (32 row increment, print 16
rows):

Maybe you could use this as an option:

Option Explicit
Sub testme01()

Dim iRow As Long
Dim HowMany As Long

HowMany = 20

With ActiveSheet
For iRow = 52 To (32 * HowMany - 1) + 52 Step 32
If IsNumeric(.Cells(iRow + 3, "I").Value) Then
If .Cells(iRow + 3, "I").Value 0 Then
.Cells(iRow, "A").Resize(16, 9).PrintPreview
'.printout when you're done checking
Exit For
End If
End If
Next iRow
End With

End Sub


Bob wrote:

I have a 20 sheet bid. I want to print half of each sheet if cell I55 is 0 print range if not then go to the next sheet check cell I87 is 0 print, or go to the next sheet and so on. What am I missing? The first sheet only works.

If [I55] 0 Then
Range("A52:I67").Select
Selection.PrintOut
Else
If [I87] 0 Then
Range("A84:I99").Select
Selection.PrintOut
Else
If [I119] 0 Then
Range("A116:I131").Select
Selection.PrintOut
End If
End If
End If
End Sub

Thank you for you help!


--

Dave Peterson

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Printing

If Worksheets("1").Range("I55") 0 Then
Worksheets("1").Range("A52:I67").Select
Selection.PrintOut
Else
If Worksheets("2").Range("I87") 0 Then
Worksheets("2").Range("A84:I99").Select

And so on

You need to set worksheet, context of work!

-----Original Message-----
I have a 20 sheet bid. I want to print half of each sheet

if cell I55 is 0 print range if not then go to the next
sheet check cell I87 is 0 print, or go to the next sheet
and so on. What am I missing? The first sheet only works.

If [I55] 0 Then
Range("A52:I67").Select
Selection.PrintOut
Else
If [I87] 0 Then
Range("A84:I99").Select
Selection.PrintOut
Else
If [I119] 0 Then
Range("A116:I131").Select
Selection.PrintOut
End If
End If
End If
End Sub

Thank you for you help!
.

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
Excel 2003 printing problem--printing 1 document on 2 pages Bons Excel Discussion (Misc queries) 0 December 24th 09 04:15 PM
Excel Printing --Borders are not printing on the same page as data Stup88 Excel Discussion (Misc queries) 1 August 7th 07 09:34 AM
Printing sammitchell Excel Discussion (Misc queries) 1 April 26th 07 12:18 PM
Printing a heading on each new page when printing Brian Excel Discussion (Misc queries) 3 November 15th 06 05:22 PM
Enable Double sided printing contiuously when printing multiple s. Lee Excel Discussion (Misc queries) 1 November 27th 04 01:58 AM


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

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

About Us

"It's about Microsoft Excel"