|
本帖最后由 hefuqing 于 2018-8-27 13:05 编辑
- Sub 保存()
- r2 = Sheets("日记账").[c65530].End(xlUp).Row
- arr = Sheets("日记账").Range("c1:c" & r2)
- Set d = CreateObject("scripting.dictionary")
- For i = 2 To r2
- d(arr(i, 1)) = ""
- Next i
- If d.Exists(Sheets("打印").[I3].Value) Then
- MsgBox "请确认是否重复录入"
- Exit Sub
- End If
- r1 = Sheets("打印").[b13].End(xlUp).Row
- If r1 < 5 Then Exit Sub
- For i = 5 To r1
- r = Sheets("日记账").[c65530].End(xlUp).Row + 1
- Sheets("日记账").Cells(r, 1) = Sheets("打印").[e3]
- Sheets("日记账").Cells(r, 2) = Sheets("打印").[C3]
- Sheets("日记账").Cells(r, 3) = Sheets("打印").[I3]
- Sheets("日记账").Cells(r, 4) = Sheets("打印").Cells(i, 2)
- Sheets("日记账").Cells(r, 5) = Sheets("打印").Cells(i, 3)
- Sheets("日记账").Cells(r, 6) = Sheets("打印").Cells(i, 4)
- Sheets("日记账").Cells(r, 7) = Sheets("打印").Cells(i, 5)
- Sheets("日记账").Cells(r, 8) = Sheets("打印").Cells(i, 6)
- Sheets("日记账").Cells(r, 9) = Sheets("打印").Cells(i, 7)
- Sheets("日记账").Cells(r, 10) = Sheets("打印").Cells(i, 8)
- Sheets("日记账").Cells(r, 11) = Sheets("打印").Cells(i, 9)
- Sheets("日记账").Columns("A:A").NumberFormatLocal = "yyyy/m/d;@"
- Next i
- MsgBox "成功录入" & r - r2 & "条"
- End Sub
复制代码
|
|