Special Print Instructions

G

GatorGirl

I have a table in excel which contains the following type of data:

Column A Column B
Column C
Member#1 Member Name1 1st Child
Name
Member#1 Member Name1 2nd Child
Name
Member#1 Member Name1 3rd Child
Name
Member#2 Member Name2 1st Child
Name
Member#2 Member Name2 2nd Child
Name
Member#5 Member Name5 1st Child
Name

I want to print only the rows which are respective to member #1, then member
#2 and so on.....I have about 4,000 rows and about 1,300 members.
Any Ideas?

Thank you-
 
D

Don Guillett

I might suggest using a for i next i loop with a filter>data filter
incorporated. Change to suit

Sub FilterAndPrint()
lr = Cells(Rows.Count, "m").End(xlUp).Row
On Error Resume Next
For i = 1 To 8
Set x = Columns("m").Find(i, LookIn:=xlValues)
If Not x Is Nothing Then
With Range("M2:Q" & lr)
.AutoFilter Field:=1, Criteria1:="Member#" & i
.PrintPreview
.AutoFilter
End With
End If
Next i
End Sub
 
G

GatorGirl

Don-You lost me. I copied your text into Visual Basic but not really sure
what the text means. If you could explain to an elementary visual basic user.

Thank you-
 
D

Don Guillett

I changed. It will filter your range a2:c last row of a, looking for 1,
2,3,etc at the end (member1, member2 ). If found it filters and prints. When
happy with this change .printPREVIEW to .printOUT. If all else fails, send
the file to my email below and I'll have a look.

Sub FilterAndPrint()
lr = Cells(Rows.Count, "a").End(xlUp).Row
On Error Resume Next
For i = 1 To 8
Set x = Columns("a").Find(i, LookIn:=xlValues)
If Not x Is Nothing Then
With Range("a2:c" & lr)
.AutoFilter Field:=1, Criteria1:="Member#" & i
.PrintPreview
.AutoFilter
End With
End If
Next i
End Sub
 

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