Variable Printing Procedure
Thanks for that Tom. I can see how it works but I know would never have
got there without your help. Many thanks.
Graham
Tom Ogilvy wrote:
Assume column C can be used to determine the extent of printing (the last
line to be printed will contain a value in column C).
Sub ABC()
Dim rng as Range, rng1 as Range, rng2 as Range
Dim i as Long
set rng = Cells(rows.count,3).End(xlup).offset(1,-1)
rng.Value = "End"
set rng1 = Range("B10",rng).SpecialCells(xlConstants)
for i = 1 to rng1.areas.count - 1
set rng2 = range(rng1(i),rng1(i+1)(0))
rng2.Resize(,16).Printout
Next
rng.ClearContents
End Sub
Assumes there will be blank cells in each range to be printed and that the
start (top left Cell) of the print area contains a constant (not a formula
and not blank).
|