我有一张用作发票的 Excel 表。
我想打印100页,并且希望发票号码从1变为100,这样每张纸都有不同的发票号码。
我怎样才能做到这一点?
答案1
您需要一个宏来实现这一点。我找到了以下宏并对其进行了一些更改。尝试一下,看看它是否正常工作:
Sub PrintCopies_ActiveSheet()
Dim CopiesCount As Long
Dim copynumber As Long
CopiesCount = Application.InputBox("How many copies do you want?", Type:=1)
'Now the program wants you to input how many pages you like to print.
'You can input 100 here.
For copynumber = 1 To CopiesCount
With ActiveSheet
.Range("E1").Value = copynumber 'I assume your invoice number is in cell E1.
.PrintOut 'Print the sheet
End With
Next copynumber
End Sub