+ Reply to Thread
Results 1 to 2 of 2

Filter and Print Problem

  1. #1
    Shawn
    Guest

    Filter and Print Problem

    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

    --
    Thanks
    Shawn

  2. #2
    Shawn
    Guest

    RE: Filter and Print Problem

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

    "Shawn" wrote:

    > 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
    >
    > --
    > Thanks
    > Shawn


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1