helpmehelen
New Member
- Joined
- Jun 13, 2018
- Messages
- 3
I have the following code to automatically print invoices. I have the print area sorted and it runs ok but i need to change the 300. The number of invoices i need to print each day and I don't know what to replace the '300' with so it prints only the data i need, rather than 300 sheets each day.
On the first tab on my workbook i have a code to hide all rows i dont need on that day so could i link my code to this to pick up the number of rows to include maybe?
Dim i As Integer
For i = 1 To 300
Range("A2").Select
ActiveCell.FormulaR1C1 = i
Range("A1:AA55").Select
Selection.PrintOut Copies:=1
Next i
End Sub
Any help would be greatly appreciated- i am pretty new to coding so apologies if my explanation isnt too good!!
On the first tab on my workbook i have a code to hide all rows i dont need on that day so could i link my code to this to pick up the number of rows to include maybe?
Dim i As Integer
For i = 1 To 300
Range("A2").Select
ActiveCell.FormulaR1C1 = i
Range("A1:AA55").Select
Selection.PrintOut Copies:=1
Next i
End Sub
Any help would be greatly appreciated- i am pretty new to coding so apologies if my explanation isnt too good!!