LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Autofilter Printing

Using the following code, I am able to automatically print (title5
Column) autofilter results
based on the autofilters of a designated column, so that I don't have
to select each autofilter one at a time and print.
__________________________________________________ ______________________

Sub abc()
Dim noDupes As New Collection
Dim rw As Long
Dim itm As Variant
Selection.AutoFilter Field:=5
rw = ActiveSheet.AutoFilter.Range.Row
For Each cell In ActiveSheet.AutoFilter.Range.Columns(5).Cells
If cell.Row < rw Then
On Error Resume Next
noDupes.Add cell.Value, cell.Text
On Error GoTo 0
End If
Next
For Each itm In noDupes
Selection.AutoFilter Field:=5, Criteria1:=itm
ActiveSheet.AutoFilter.Range.PrintPreview
Next
__________________________________________________ ______________________


I would now like to add a function to the macro that would allow me to
print those same results based on the month that I choose.


Example Below:
Name Title 2 Title 3 Title 4 Title 5 Month
Data 1 101 10 101 Unique Data1 February
Data 2 101 10 101 Unique Data1 February
Data 3 101 10 101 Unique Data2 February
Data 4 101 10 101 Unique Data3 March
Data 5 101 10 101 Unique Data4 March
Data 6 101 10 101 Unique Data5 April
Data 7 101 10 101 Unique Data1 May


Is there a way to do this?

 
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
excel 2007 autofilter change to 2003 autofilter functionality? jonnybrovo815 Excel Discussion (Misc queries) 1 April 19th 10 10:05 PM
2007 excel autofilter change back to 2003 autofilter? jonnybrovo815 Excel Discussion (Misc queries) 1 April 19th 10 05:53 PM
Printing from Userform with AutoFilter Vikram Excel Discussion (Misc queries) 0 August 7th 06 03:20 AM
Printing Headers using Criteria chosen from AutoFilter Sondra Excel Programming 2 April 10th 06 10:14 PM
Printing slected items after using autofilter robertguy Excel Discussion (Misc queries) 1 September 29th 05 02:45 PM


All times are GMT +1. The time now is 07:20 PM.

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"