View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett[_4_] Don Guillett[_4_] is offline
external usenet poster
 
Posts: 2,337
Default various printing from a hiden sheet

try this. chg sheet to yours and printpreview to printout
Sub printeachchange()
With Sheets("sheet5")
..Visible = True
LastRow = .Cells(Rows.Count, "b").End(xlUp).Row
For i = LastRow To 2 Step -1
y = Application.CountIf(.Range("b:b"), .Cells(i, "b"))
If .Cells(i - 1, "b") < .Cells(i, "b") Then
..Cells(i, "b").Resize(y, 1).entirerow.PrintPreview
End If
Next i
..Visible = False
End With
End Sub

--
Don Guillett
SalesAid Software

"Shawn" wrote in message
...
I have a hidden sheet with a table of data. Column B:B has various

employee
names in it in desending alphabetical order. I would like a macro that
would, without selecting the page if possible, print out all rows of data
with employee A, then, on another sheet, print out all rows of data with
employee B, then employee C and so on.

For example, if Smith, Tom is repeated in Rows B2, B3, B4, I would want it
to print Rows 2, 3 and 4 on a sheet of paper. Then if Thompson, Jill is
repeated in B5, B6, B7, I would want it to print rows 5, 6 and 7 on the

next
sheet. Please help.


--
Thanks
Shawn