|
2楼正解
代码如下:
- Sub 入库新增保存()
- ReDim brr(1 To 17)
- With Worksheets("入库新增")
- If .Range("c4") = Empty Then
- MsgBox "没有要保存的数据!"
- Exit Sub
- End If
- brr(1) = .Range("k6")
- brr(2) = .Range("g4")
- brr(3) = .Range("c6")
- brr(4) = .Range("c4")
- brr(5) = .Range("j4")
- brr(6) = .Range("g6")
- brr(7) = .Range("c8")
- End With
- With Worksheets("入库登记明细表")
- r = .Cells(.Rows.Count, 1).End(xlUp).Row
- .Cells(r + 1, 1).Resize(1, 17) = brr
- End With
- '新增下面这行代码
- <font color="#ff0000"> ThisWorkbook.Save</font>
- MsgBox "此记录已保存", vbOKOnly, "温馨提示"
- Exit Sub
- End Sub
复制代码
|
|