Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

loop print on an excel form and merge data from table to print on each record.

Posted on 2013-12-26
3
Medium Priority
?
481 Views
Last Modified: 2013-12-26
Hi.  I have an attendance form in Excel that I print out every year.  Normally I print out about 300 copies of the form and then stick employee name labels on each hardcopy but I'm thinking there has to be an easier way.  

Cell P2 on my excel form has a space for the name.  All of the employee names are in a separate excel sheet.  Can anyone think of a way to pull the name from my excel table and insert into cell P2 on my form for each print of this form, printing just enough copies of the form as there are records in the employee name spreadsheet?  thanks
0
Comment
Question by:valmatic
3 Comments
 
LVL 1

Expert Comment

by:SolveEtCoagula07
ID: 39740474
Could you post a copy of your document?
0
 
LVL 53

Accepted Solution

by:
Rgonzo1971 earned 2000 total points
ID: 39740635
Hi

you could it like this

In a sheet calles Names you have the employee first names in ColA LastNames in ColB with a Header

The Sheet called Form will be filled with the Full Name Of Each Employee and printed

Sub Macro()
Sheets("Names").Activate
For Each c In Range(Range("A2"), Range("A" & Cells.Rows.Count).End(xlUp))
    FullName = c & " " & c.Offset(0, 1)
    Sheets("Form").Range("P2").Formula = FullName
    Sheets("Form").PrintOut
Next
End Sub

Open in new window

Regards
0
 
LVL 7

Author Closing Comment

by:valmatic
ID: 39740808
I tweaked it a bit but that took me where I wanted to go.  thanks for the help.

:)
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

879 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question