Forum Discussion
Ldelgado3914
Nov 01, 2023Copper Contributor
Excel to print individual pages by rows
I have an excel template along with an excel data sheet within the same workbook. I have successfully assigned the cell values into the template. When I put in a badge number on the template it bring...
- Nov 01, 2023
You might use mail merge in Word with the Excel sheet as data source.
HansVogelaar
Nov 01, 2023MVP
You might use mail merge in Word with the Excel sheet as data source.
Ldelgado3914
Nov 01, 2023Copper Contributor
Thank you for your reply. The data needed will not fit on a word document accurately due to the needed width of each column. 😔
- HansVogelaarNov 01, 2023MVP
Apparently I don't understand what you want, sorry. Could you describe it in more detail.
- Ldelgado3914Nov 01, 2023Copper ContributorI have prepared an excel template for open enrollment. The data sheet contains employees badge numbers and their current coverages.
I have assigned the cells needed on the enrollment form template.
When I put the badge number on the enrollment form the data pulls from my data sheet correctly.
What I'm trying to accomplish is to print all 50 employees enrolment forms as a workbook instead of having to enter every employees badge number and printing the forms individually.- HansVogelaarNov 01, 2023MVP
If you use the desktop version of Excel for Windows or Mac, you can use a macro to do this.
It could look like this - you'll have to modify it for your workbook.
Sub PrintBadges() Dim wsh1 As Worksheet Dim wsh2 As Worksheet Dim r As Long Dim m As Long ' The sheet with the employee data Set wsh1 = Worksheets("Data Sheet") ' The sheet with the enrollment form Set wsh2 = Worksheets("Form Sheet") ' I assumed that the badge numbers are in column A of the data sheet ' m is the row number of the last used row in that column m = wsh1.Range("A" & wsh1.Rows.Count).End(xlUp).Row ' Loop from row 2 to the last row For r = 2 To m ' I assumed that the badge number has to be entered in B2 of the form sheet ' Copy the badge number from the data sheet to the form sheet wsh2.Range("B2").Value = wsh1.Range("A" & r).Value ' Print the form sheet wsh2.PrintOut Next r End Sub