Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 271
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 271
Default 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
filter: how to print filter list options in dropdown box help please Excel Discussion (Misc queries) 2 October 17th 07 01:53 AM
Print Filter?? Toaster Excel Worksheet Functions 0 March 4th 06 06:09 PM
Print Filter? Toaster Excel Discussion (Misc queries) 0 March 4th 06 06:07 PM
filter 15 worksheets so i can print all on one page kristie626 Excel Worksheet Functions 1 August 16th 05 10:22 PM
Applying second filter and set print area Soniya Excel Programming 1 September 3rd 03 01:05 PM


All times are GMT +1. The time now is 07:55 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"