Sub 伙食费开单()
Union([c2], [c3], [d3], [e4], [e5], [i7]) = ""
[c2] = Format(Now, """HS""Fyyyymmddhhmmss")
End Sub
Sub 开学费保存()
With Sheets("费用记录")
Set rng = .Cells(Rows.Count, 1).End(xlUp)
Set frng = .Columns(1).Find([c2].Value, , , xlWhole)
If frng Is Nothing Then
rng.Offset(1, 0) = [c2] '单号
rng.Offset(1, 1) = [c3] '班别
rng.Offset(1, 2) = [d3] '姓名
rng.Offset(1, 7) = [e4] '被子
rng.Offset(1, 8) = [e5] '书包
rng.Offset(1, 9) = [e6] '校服
rng.Offset(1, 10) = [i8] '合计金额
rng.Offset(1, 11) = Date '交费时间
MsgBox "保存成功!"
Else
MsgBox "您已经保存过了!"
End If
End With
End Sub
|