INOpportuno
New Member
- Joined
- Jul 5, 2023
- Messages
- 6
- Office Version
- 2021
- Platform
- Windows
I found in this forum how to printout sheets with different values, but I'd like to print all the sheets in a single PDF Document.
How can I fix this VBA code to do this?
Sub PrintAll()
Dim i As Long, LastRow As Long
LastRow = Worksheets("Names").Range("A65536").End(xlUp).Row
For i = 1 To LastRow
Worksheets("Form").Range("A1").Value = Worksheets("Names").Range("A" & i).Value
Worksheets("Form").Range("Print_Me").PrintOut
Next i
End Sub
How can I fix this VBA code to do this?
Sub PrintAll()
Dim i As Long, LastRow As Long
LastRow = Worksheets("Names").Range("A65536").End(xlUp).Row
For i = 1 To LastRow
Worksheets("Form").Range("A1").Value = Worksheets("Names").Range("A" & i).Value
Worksheets("Form").Range("Print_Me").PrintOut
Next i
End Sub