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

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