|
Sub 明细账()
MsgBox "提示:未经复核签名的入库数据不能登入明细分类帐!", 64, "学习!"
With Sheets("入库汇总")
X = .[P65536].End(x1up).Row
'确定最后一张经复核签名的入库单第一行所在的行号
For Y = 2 To 4
If .Cells(X + Y, 1) <> "" And .Cells(X + Y, 16) = "" Then
Y = Y - 1
Exit For
End If
Next Y
R = X + Y
End With
Sheets("入库汇总").protected Password:="******"
Sheets("入库汇总").EnableSelection = x1noselection
With Sheets("修理配件类")
KA = .[A65536].End(x1up).Row + 1
For OB = 3 To R
Set sh_r = Sheets("入库汇总")
If sh_r.Cells(OB, 6) = "修理配件类" Then
If sh_r.Cells(OB, 6).Offset(0, 5) <> "" Then
.Cells(KA, 3) = sh_r.Cells(OB, 6).Offset(0, -5) '编码
.Cells(KA, 7) = sh_r.Cells(OB, 6).Offset(0, -3) '单位
.Cells(KA, 5) = sh_r.Cells(OB, 6).Offset(0, -1) '名称
.Cells(KA, 4) = sh_r.Cells(OB, 6).Offset(0, 3) '单价
.Cells(KA, 8) = sh_r.Cells(OB, 6).Offset(0, 4) '数量
End If KA = KA + 1
End If
Next
KA = .[A65536].End(x1up).Row
.Activate
.Protect Password:="******"
.EnableSelection = x1unlockedcells
End With
End Sub
代码在模块一中,运行时黄色部分出错!求高手帮忙检查一下,不胜感激!
学习!.zip
(127.4 KB, 下载次数: 7)
|
|