Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Conditional Printing


Hi all,

Just a quick one. When rng.value is greater than 0, it prints page one.
However, when rng1.value is greater than 0, it doesn't print page 2 or
3.

Sorry about the poor explanation - but the dog really needs a walk....



Public Sub Tester002()

Dim rng As Range
Dim rng1 As Range


Set rng = ActiveWorkbook.Sheets("STATEMENTS").Range("N46")
Set rng1 = ActiveWorkbook.Sheets("STATEMENTS").Range("A52")


If rng.Value 0 Then
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1, Collate
_
:=True
ElseIf rng = 0 Then
Exit Sub
If rng1.Value 0 Then
ActiveWindow.SelectedSheets.PrintOut From:=2, To:=2, Copies:=1, Collate
_
:=True

Else
ActiveWindow.SelectedSheets.PrintOut From:=3, To:=3, Copies:=1, Collate
_
:=True

End If
End If
End Sub


--
chris100
------------------------------------------------------------------------
chris100's Profile: http://www.excelforum.com/member.php...o&userid=25166
View this thread: http://www.excelforum.com/showthread...hreadid=511312

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Conditional Printing

Hi

Do you ojnly want to print the rng.value page ??
Then use this

If rng.Value 0 Then
ActiveWindow.SelectedSheets.PrintOut From:=rng.Value, To:=rng.Value, Copies:=1
End If


--
Regards Ron de Bruin
http://www.rondebruin.nl


"chris100" wrote in message
...

Hi all,

Just a quick one. When rng.value is greater than 0, it prints page one.
However, when rng1.value is greater than 0, it doesn't print page 2 or
3.

Sorry about the poor explanation - but the dog really needs a walk....



Public Sub Tester002()

Dim rng As Range
Dim rng1 As Range


Set rng = ActiveWorkbook.Sheets("STATEMENTS").Range("N46")
Set rng1 = ActiveWorkbook.Sheets("STATEMENTS").Range("A52")


If rng.Value 0 Then
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1, Collate
_
:=True
ElseIf rng = 0 Then
Exit Sub
If rng1.Value 0 Then
ActiveWindow.SelectedSheets.PrintOut From:=2, To:=2, Copies:=1, Collate
_
:=True

Else
ActiveWindow.SelectedSheets.PrintOut From:=3, To:=3, Copies:=1, Collate
_
:=True

End If
End If
End Sub


--
chris100
------------------------------------------------------------------------
chris100's Profile: http://www.excelforum.com/member.php...o&userid=25166
View this thread: http://www.excelforum.com/showthread...hreadid=511312



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


Not quite Ron, I'll explain properly now that i have more time:

The worksheet "statements" has three pages.
Page one is always printed if "N46" is greater than zero.
Page two prints if "A52" is greater than zero.
Page 3 always prints if "N46" is greater than zero.

What you can see happening here is that page 1 is printed if the
customer has an outstanding balance, then page two prints if there is
more to the statement history. Page three is a Statement summary and
prints if there is something to print i.e when the first page prints.
Obviously they have to print in that order.

Phew! Hope i explained that a bit better.

Thanks for helping,

Chris


--
chris100
------------------------------------------------------------------------
chris100's Profile: http://www.excelforum.com/member.php...o&userid=25166
View this thread: http://www.excelforum.com/showthread...hreadid=511312

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Conditional Printing

Try this

Public Sub Tester002()

Dim rng As Range
Dim rng1 As Range

Set rng = ActiveWorkbook.Sheets("STATEMENTS").Range("N46")
Set rng1 = ActiveWorkbook.Sheets("STATEMENTS").Range("A52")

If rng.Value 0 Then
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1, Copies:=1, Collate:=True
End If

If rng1.Value 0 Then
ActiveWindow.SelectedSheets.PrintOut From:=2, To:=2, Copies:=1, Collate:=True
End If

If rng.Value 0 Then
ActiveWindow.SelectedSheets.PrintOut From:=3, To:=3, Copies:=1, Collate:=True
End If

End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"chris100" wrote in message
...

Not quite Ron, I'll explain properly now that i have more time:

The worksheet "statements" has three pages.
Page one is always printed if "N46" is greater than zero.
Page two prints if "A52" is greater than zero.
Page 3 always prints if "N46" is greater than zero.

What you can see happening here is that page 1 is printed if the
customer has an outstanding balance, then page two prints if there is
more to the statement history. Page three is a Statement summary and
prints if there is something to print i.e when the first page prints.
Obviously they have to print in that order.

Phew! Hope i explained that a bit better.

Thanks for helping,

Chris


--
chris100
------------------------------------------------------------------------
chris100's Profile: http://www.excelforum.com/member.php...o&userid=25166
View this thread: http://www.excelforum.com/showthread...hreadid=511312



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
conditional printing Conditional printing Excel Discussion (Misc queries) 4 September 15th 08 01:51 PM
Conditional Printing James[_4_] Excel Discussion (Misc queries) 1 July 24th 07 10:45 PM
Conditional Printing Josh Whitney Excel Programming 5 June 12th 04 12:26 AM
conditional printing skitek Excel Programming 1 June 9th 04 03:04 PM
conditional printing raymondsum[_9_] Excel Programming 4 December 3rd 03 02:24 AM


All times are GMT +1. The time now is 05:32 PM.

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"