View Single Post
  #4   Report Post  
Ron de Bruin
 
Posts: n/a
Default

Try this (all in one sub)

Sub Printtest()
Dim sh As Worksheet
Dim Astr
Dim N As Long

Astr = Array("Delivery Copy", "Client Copy", "Admin Copy", "dock_copy")
For N = LBound(Astr) To UBound(Astr)

For Each sh In ThisWorkbook.Worksheets
With sh
.Range("E4").Value = Astr(N)
End With
Next sh
Worksheets.PrintOut
Next N
End Sub


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



"Peter" wrote in message ...
Hi Ron,
Thanks for the dot =)
Unfortunatly it's still not printing the sheets the way they should be.

It dosn't seem to stop after it enters the new text into "B4" and print what
is on the sheets.
It should do this:
<=====call sub client_copy
Change B4 to Client Copy on all sheets.
Print all sheets
<=====call sub admin_copy
Change B4 to Admin Copy on all sheets
Print all sheets
<=====call sub delivery_copy
Change B4 to Delivery Copy on all sheets
Print all sheets
<=====call sub dock_copy
Change B4 to Dock Copy on all sheets
Print all sheets

Instead it gives the correct amount of pages, just all with Dock Copy on them.

Any idea's what I may have missed?

Regards
Peter


"Ron de Bruin" wrote:

Hi Peter

You missed a dot before .Range(............

Sub delivery_copy()
Dim sh As Worksheet
For Each sh In ThisWorkbook.Worksheets
With sh
.Range("E4").Value = "Delivery Copy"
End With
Next sh
Worksheets.PrintOut
End Sub


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



"Peter" wrote in message ...
Hello All..

I am trying to get my worksheets to play nicely..but no success.

I have say 10 worksheets, and in cell "B4" I have Client Copy (across all
sheets), so it needs to print all those sheets...
Then I need to change "B4" to Delivery Copy, then print all those sheets,
etc etc

Problem is at the moment, it goes through all the sheets, and only prints
the Dock Copy sheets (the last set). I see the text at "B4" change to what it
should, but just keeps going and ignoring the print call.

Sub delivery_copy()
Dim sh As Worksheet
For Each sh In ThisWorkbook.Worksheets
With sh
Range("E4").Select
ActiveCell = "Delivery Copy"
End With
Next sh
Worksheets.PrintOut

End Sub

I am using this in four seperate modules, each called from Sub
Workbook_BeforePrint.
As always, any advice is welcomed.

Regards
Peter