How to set and print an auto increment number plus 1 for the delivery note number in excel form?

Reported answer
How to set and print an auto increment number plus 1 for the delivery note number in excel form?
Ask online customer service
Scan the code to ask online customer service
  • Number of answers

    three

  • Number of browses

    6,692

3 answers Default sorting
  • Default sorting
  • Sort by time

Adopted
According to the problem description, we can use Excel's VBA programming to realize the function of increasing 1 at a time. First, open the Excel development tool tab and enter the following code in the VBA editor:
```
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim lastRow As Long
lastRow = Range("A1"). End(xlUp). Row
For i = lastRow + 1 To Range("A1"). End(xlUp). Row
Range("A" & i). Value = Range("A1"). Value + 1
Next i
End Sub
```
This code will print the delivery note number line by line and add 1 after each delivery note.
In addition, Microsoft Excel is an office software developed by Microsoft, which is mainly used for data processing, statistical analysis and decision-making. It has many functions, such as opening or closing table header rows, adjusting each row with a single formula, sorting and filtering data, and so on. In Excel, you can use a large number of formula functions to perform calculations and manage the data information list and data chart making in spreadsheets or web pages. Word, PowerPoint, Access and other software are also combined with it.
It should be noted that VBA programming is supported in Excel 2003, but it is not common in earlier versions. The latest version adds many functions, making Excel more powerful.
cancel comment
Assume that the delivery note number is in A1, Alt+F11, and add the following code, 1 will be added at a time
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Range(A1) = Range(A1) + 1
End Sub
cancel comment
Send a picture to have a look
cancel comment
ZOL Q&A > How to set and print an auto increment number plus 1 for the delivery note number in excel form?

report

Thank you for contributing to the harmony of the community. Please select the type of report

Reported successfully

It will be handled after verification
Thank you for your contribution to community harmony

Scan the code to participate in the trial of new products at 0 yuan
You can get the sheets and grand gifts on the top floor

 Scan and pay attention to us
Tips

Are you sure you want to cancel this registration and exit this activity?