Filter and Print Problem

G

Guest

Here is a code I have...it isn't filtering and printing just right???? What
it prints out is the first line of everybody's data over and over, instead of
printing out everything per person then cycling to the next person???? My
apologizes for posting this again.

Sheets("Stepdown3").Select
Columns("B:B").Select
For Each Cell In Selection.SpecialCells(xlConstants, 23)
If Cell.Value <> 0 Then
Cell.Select
With Sheets("Letter")
.Range("C13").Value = Selection.Value
.Range("E13").Value = Selection.Offset(0, -1).Value
.Range("C14").Value = Selection.Offset(0, 1).Value
.Range("I24").Value = Selection.Offset(0, 8).Value
.Range("I27").Value = Selection.Offset(0, 7).Value
.Range("I30").Value = Selection.Offset(0, 10).Value
.PrintOut Copies:=1
End With

Set sht = Sheets("Stepdown2")

topRow = sht.Range("B1").End(xlDown).Row
bottomRow = sht.Range("B65536").End(xlUp).Row
Set NameRange = sht.Range("B" & topRow & ":B" & bottomRow)


sht.AutoFilter Field:=1,
Criteria1:=Sheets("Letter").Range("C13").Value, VisibleDropdown:=False
sht.Visible = xlSheetVisible
sht.PrintOut
sht.Visible = xlSheetHidden

End If
Next Cell
 
G

Guest

The problem starts with "Sheet2". The "letter" sheet prints like it is
supposed to.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top