|
楼主 |
发表于 2018-12-31 14:27:31
|
显示全部楼层
Sub 开单()
Set es = Cells.Find("*", , xlFormulas, , , xlPrevious)
[b2] = "SM" & Format(Now(), "ymdhms")
Range([a5], es.Offset(4)) = ""
[e2] = ""
End Sub
Sub 保存()
On Error GoTo 100
Dim es As Range, a%
If Sheet2.[f:f].Find([b2]) = [b2] Then
MsgBox "已经保存过了!"
Else
100:
Set es = Cells.Find("*", , xlFormulas, , , xlPrevious)
a = Application.CountA(Sheet2.[a:a])
If es.Row = 4 Then MsgBox "没有填写内容": End
Range([a5], es).Copy Sheet2.Cells(a + 1, 1)
Sheet2.Cells(a + 1, "f").Resize(es.Row - 4) = [b2] '保存入库单
Sheet2.Cells(a + 1, "g").Resize(es.Row - 4) = [e2] '保存供应商
Sheet2.Cells(a + 1, "h").Resize(es.Row - 4) = Now() '保存日期时间
MsgBox "保存成功!"
End If
End Sub
Sub 计算()
Set es = Columns(3).Find("*", , xlFormulas, , , xlPrevious)
For Each Rng In Range([c5], es)
Rng.Offset(0, 2) = Rng.Offset(0, 1) * Rng
Next
End Sub
|
|