Im using the following code to print a sheet that changes a value each time. Its working fine. Only issue is that I have to save each print as a seperate PDF. How do I get them to be all in one file?
VBA Code:
Private Sub CommandButton1_Click()
For x = 1 To 100 'increase the 100 to a larger number if you ever have more than 100 sheets
If Sheets("Sheet2").Range("T" & x).Value = "" Then Exit Sub
Sheets("Sheet2").Range("F4").Value = Sheets("Sheet2").Range("T" & x).Value
Sheets("Sheet2").Range("F3").Value = Sheets("Sheet2").Range("U" & x).Value
ActiveSheet.PrintOut Copies:=1, Collate:=True
Next
End Sub