|
楼主 |
发表于 2023-7-6 19:35
|
显示全部楼层
Sub 收付款凭证保存()
Application.ScreenUpdating = False
Dim n%, m%, x%, y%, k%
Set sht = Sheets("收付款凭证")
On Error GoTo 100
If Sheets("收付款凭证数据库").[A:A].Find([M2]) = sht.[M2] Then
MsgBox "此单已经保存过了!请重新开单"
Else
100:
If [D3] = "" Or [M3] = "" Then MsgBox "信息没有填写完整,不能保存!": End
m = Sheets("收付款凭证数据库").[A65536].End(xlUp).Row + 1
With Sheets("收付款凭证数据库")
.Cells(m, "A").Value = [M2] '编号
.Cells(m, "B").Value = [J2] '日期
.Cells(m, "C").Value = [D3] '客户名称
.Cells(m, "D").Value = [I3] '联系人
.Cells(m, "E").Value = [M3] '收付类型
.Cells(m, "F").Value = [C4] '收款事由
.Cells(m, "G").Value = [M5] '收款金额
.Cells(m, "H").Value = [M6] '收付方式
.Cells(m, "I").Value = [B6] '备注
End With
MsgBox "提交收付款凭证保存成功!"
End If
ActiveWorkbook.Save
Application.ScreenUpdating = True
End Sub |
评分
-
1
查看全部评分
-
|