LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Filter & Print

Laurie,

Try the macro "DoPrintOuts", below.

HTH,
Bernie
MS Excel MVP

Sub DoPrintOuts()
Dim mySht As Worksheet
For Each mySht In ActiveWorkbook.Worksheets
PrintByFilter Intersect(mySht.UsedRange, mySht.Range("I:I"))
Next mySht
End Sub

Sub PrintByFilter(myRange As Range)
Dim myList() As Variant
Dim i As Integer
Dim j As Integer
Dim mycount As Integer
mycount = 1
With myRange
..AdvancedFilter Action:=xlFilterInPlace, Unique:=True
ReDim myList(1 To .SpecialCells(xlCellTypeVisible).Count)
With .SpecialCells(xlCellTypeVisible)
For j = 1 To .Areas.Count
For i = 1 To .Areas(j).Cells.Count
myList(mycount) = .Areas(j).Cells(i).Value
mycount = mycount + 1
Next i
Next j
End With
myRange.Parent.ShowAllData
End With

For i = LBound(myList) + 1 To UBound(myList)
myRange.AutoFilter Field:=1, Criteria1:=myList(i)
myRange.Parent.PrintOut
Next i

End Sub



"laurie g" wrote in message
...
Would like a macro that would Filter the rows by Col I and then print all the
data based on Col I
Col A = No. Col F = Place
Col B = Name Col G = Best Time
Col C = 1st Run Col H = Club
Col D = 2nd Run Col I = Age Group
Col E = 3rd Run

I have an auto filter on Col I that I select an age group then print that
page then select another Age Group and print again etc. What I would like to
do is run a VBA on a keyboard assign key that would print all the data based
on all the different age groups for that worksheet.
I have 12 plus worksheets and each sheet can have 150 plus rows of data
The cells in Col I are based on a list.
Can email file for your info

Many thanks
Laurie g



 
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
hide filter arrows on print lee Excel Discussion (Misc queries) 0 February 4th 09 07:09 PM
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 and Print Problem Shawn Excel Programming 1 March 7th 05 07:29 PM


All times are GMT +1. The time now is 03:10 AM.

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

About Us

"It's about Microsoft Excel"