Forum Discussion
Marinka
Feb 21, 2024Copper Contributor
Question about an Excel form
I have a form that I print out monthly after I make date changes. I have to print this and other forms for multiple people. The form is the same, except for their name at the top. Right now I have...
Marinka
Feb 21, 2024Copper Contributor
Thank you!! Let me clarify some things.
The name is to be entered in A1 on the sheet.
I'm on a Mac Mini using Excel.
I don't have an ALT button.
Will this still work?
The name is to be entered in A1 on the sheet.
I'm on a Mac Mini using Excel.
I don't have an ALT button.
Will this still work?
HansVogelaar
Feb 21, 2024MVP
Use Option instead of Alt:
Option+F11 to activate the Visual Basic Editor
Option+F8 to activate the Macros dialog.
Change the macro as follows:
Sub PrintForms()
Dim FormSheet As Worksheet
Dim ListSheet As Worksheet
Dim NameRow As Long
Dim LastRow As Long
Application.ScreenUpdating = False
' The sheets to be used
Set FormSheet = Worksheets("Form") ' change name as needed
Set ListSheet = Worksheets("List") ' change name as needed
' The row of the last name
LastRow = ListSheet.Range("A1").End(xlDown)
' Loop through the names
For NameRow = 2 To LastRow
' Enter the next name in A1 on the form sheet
FormSheet.Range("A1").Value = ListSheet.Range("A" & NameRow).Value
' Print the form sheet
FormSheet.PrintOut
Next NameRow
Application.ScreenUpdating = True
End Sub