- ·上一篇:excel表格行乘列之和怎么算
- ·下一篇:excel表格星期怎么下拉排序
excel表格销售单编号怎么编
2025-12-06 15:40:07
1.excel做个销售单,怎样自动插入单号
自己做个打印按钮Sub myprint()Dim x As StringIf Application.Dialogs(xlDialogPrint).Show = True Then x = Sheet1.Range("A1") x = x + 1 Sheet1.Range("A1") = xEnd IfEnd Sub生成单号就在thisworkbook插入下边的代码就可以了Private Sub Workbook_Open() Dim a As String Sheet1.Range("A1").NumberFormatLocal = "@" If Month(Date) < 10 Then a = Year(Date) & 0 & Month(Date) & Day(Date) & "0001" Else a = Year(Date) & Month(Date) & Day(Date) & "0001" End If If Left(Sheet1.Range("a1"), 8) <> Left(a, 8) Then Sheet1.Range("a1") = a End IfEnd Sub。
