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, 5) = [e4] '伙食费
rng.Offset(1, 6) = [e5] '退费
rng.Offset(1, 10) = [i7] '合计金额
rng.Offset(1, 11) = Date '交费时间
MsgBox "保存成功!"
Else
MsgBox "您已经保存过了!"
End If
End With
End Sub |