|
Sub 提交()
Application.ScreenUpdating = False
Dim n%, m%, x%, y%, k%
On Error GoTo 100
If Sheets("抄表电量日报").[A:CI].Find([F6,G6,H6,I6,J6]) = [F6,G6,H6,I6,J6] Then
MsgBox "已经保存过了!"
Else
100:
If [F6] = "" Or [H6] = "" Or [J6] = "" Or [F12] = "" Then MsgBox "信息没有填写完整,不能保存!": End
m = Sheets("抄表电量日报").这个地方应该是要判断单元格日期与我当前表的日期一致。我不会弄了,跪求大神
With Sheets("抄表电量日报")
.Cells(m, "A").Value = [F6] '正向有功
.Cells(m, "B").Value = [F7] '正向无功
.Cells(m, "C").Value = [G6] '方向有功
.Cells(m, "D").Value = [G7] '反向无功
.Cells(m, "E").Value = [H6] '301甲有功
.Cells(m, "F").Value = [H7] '301甲无功
.Cells(m, "G").Value = [I6] '301乙有功
.Cells(m, "H").Value = [I7] '301乙无功
.Cells(m, "I").Value = [J6] '3911有功
.Cells(m, "J").Value = [J7] '3911无功
.Cells(m, "K").Value = [F9] '311有功
.Cells(m, "L").Value = [F10] '311无功
.Cells(m, "M").Value = [G9] '312有功
.Cells(m, "N").Value = [G10] '312无功
.Cells(m, "O").Value = [H9] '313有功
.Cells(m, "P").Value = [H10] '313无功
.Cells(m, "Q").Value = [I9] '314有功
.Cells(m, "R").Value = [I10] '314无功
.Cells(m, "S").Value = [J9] '315有功
.Cells(m, "K").Value = [J10] '315无功
.Cells(m, "L").Value = [F12] '361有功
.Cells(m, "M").Value = [F13] '361无功
.Cells(m, "N").Value = [G12] '321有功
.Cells(m, "O").Value = [G13] '321无功
.Cells(m, "P").Value = [H12] '322有功
.Cells(m, "Q").Value = [H13] '322无功
.Cells(m, "R").Value = [I12] '3921有功
.Cells(m, "S").Value = [I13] '3921无功
End With
MsgBox "提交成功!"
End If
ActiveWorkbook.Save
Application.ScreenUpdating = True
End Sub
|
|