Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Printing Report Card

0 views
Skip to first unread message

Salza

unread,
Dec 31, 2009, 8:22:37 PM12/31/09
to
I am using Excel 2007 to prepare an exam worksheet. Data in SheetA,
Report Card in SheetB.
With validation list, I choose name to get each student's mark in the
report card.
Then I could print the report card. The thing is I have to do this one
by one..that is.. to select one name and print a copy .How do I print
all the report cards at one go. Can someone suggest a macro to do
this? Thanks.

Roger Govier

unread,
Jan 1, 2010, 5:04:15 AM1/1/10
to
Hi

The following should get you started.
Change the ranges to suit where your names a re located on Sheet1, and the
cell where you select the Student name manually on Sheet2

Sub Printcards()
Dim c As Range
Dim wss As Worksheet
Dim wsd As Worksheet

Set wss = ThisWorkbook.Sheets("Sheet1")
Set wsd = ThisWorkbook.Sheets("Sheet2")
' next line assumes Name are in column A starting at row 2
For Each c In wss.Range("A2:A" _
& wss.Range("A65536").End(xlUp).Row)
' change B4 in next line to match the cell where you select Student
Name
wsd.Range("B4").Value = c.Value

ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=False
Next
End Sub

--
Regards
Roger Govier

"Salza" <zainu...@gmail.com> wrote in message
news:53a156d1-85f0-4b4d...@u7g2000yqm.googlegroups.com...

> __________ Information from ESET Smart Security, version of virus
> signature database 4733 (20091231) __________
>
> The message was checked by ESET Smart Security.
>
> http://www.eset.com
>
>
>

__________ Information from ESET Smart Security, version of virus signature database 4733 (20091231) __________

The message was checked by ESET Smart Security.

http://www.eset.com

Salza

unread,
Jan 1, 2010, 5:34:31 AM1/1/10
to
On Jan 1, 6:04 pm, "Roger Govier" <roger@technology4unospamdotcodotuk>
wrote:

> Hi
>
> The following should get you started.
> Change the ranges to suit where your names a re located on Sheet1, and the
> cell where you select the Student name manually on Sheet2
>
> Sub Printcards()
>     Dim c As Range
>     Dim wss As Worksheet
>     Dim wsd As Worksheet
>
>     Set wss = ThisWorkbook.Sheets("Sheet1")
>     Set wsd = ThisWorkbook.Sheets("Sheet2")
>     ' next line assumes Name are in column A starting at row 2
>     For Each c In wss.Range("A2:A" _
>                             & wss.Range("A65536").End(xlUp).Row)
>         ' change B4 in next line to match the cell where you select Student
> Name
>         wsd.Range("B4").Value = c.Value
>
>         ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=False
>     Next
> End Sub
>
> --
> Regards
> Roger Govier
>
> "Salza" <zainudd...@gmail.com> wrote in message

>
> news:53a156d1-85f0-4b4d...@u7g2000yqm.googlegroups.com...
>
>
>
> > I am using Excel 2007 to prepare an exam worksheet. Data in SheetA,
> > Report Card in SheetB.
> > With validation list, I choose name to get each student's mark in the
> > report card.
> > Then I could print the report card. The thing is I have to do this one
> > by one..that is.. to select one name and print a copy .How do I print
> > all the report cards at one go. Can someone suggest a macro to do
> > this? Thanks.
>
> > __________ Information from ESET Smart Security, version of virus
> > signature database 4733 (20091231) __________
>
> > The message was checked by ESET Smart Security.
>
> >http://www.eset.com
>
> __________ Information from ESET Smart Security, version of virus signature database 4733 (20091231) __________
>
> The message was checked by ESET Smart Security.
>
> http://www.eset.com

Thank you, Roger. I will try it in a short while and let you know the
result. Will take me time as I am new to this.
Happy New Year to you

Don Guillett

unread,
Jan 1, 2010, 8:51:34 AM1/1/10
to

I assume you have a remote list of the names.
sub printemall()
for each n in range("b2:b22")
put the data where it goes with this line
activesheet.printout
next n
end sub
If desired, send your file to my address below. I will only look if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
dguil...@austin.rr.com
"Salza" <zainu...@gmail.com> wrote in message
news:53a156d1-85f0-4b4d...@u7g2000yqm.googlegroups.com...

clr

unread,
Jan 1, 2010, 2:14:31 PM1/1/10
to
File > Print > Entire Workbook > ok

Vaya con Dios,
Chuck, CABGx3


"Salza" <zainu...@gmail.com> wrote in message
news:53a156d1-85f0-4b4d...@u7g2000yqm.googlegroups.com...

0 new messages