Solved

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

Posted on 2013-12-26
3
453 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 49

Accepted Solution

by:
Rgonzo1971 earned 500 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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

823 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