|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Private Sub CommandButton1_Click()
Range("a11:f17").ClearContents
Range("t11:t17").ClearContents
a1 = [f5].Value: a2 = [g5].Value
k = 11
With Sheets("进仓单")
For i = 0 To 999
If .Cells(i * 15 + 1, 1).Value = "进 仓 单" Then
For j = 5 To 10
If .Cells(i * 15 + j, 1).Value = a1 And a2 - .Cells(i * 15 + j, 2).Value = 0 Then
Cells(k, 1).Value = .Cells(i * 15 + 2, 1).Value '日期
Cells(k, 3).Value = .Cells(i * 15 + 2, 6).Value '凭证号
Cells(k, 4).Value = .Cells(i * 15 + 3, 1).Value '摘要
Cells(k, 6).Value = .Cells(i * 15 + j, 4).Value '收入数量
k = k + 1: If k = 18 Then Exit Sub
End If
Next
Else
Exit For
End If
Next
End With
With Sheets("出仓单")
For i = 0 To 999
If .Cells(i * 15 + 1, 1).Value = "出 仓 单" Then
For j = 5 To 10
If .Cells(i * 15 + j, 1).Value = a1 And a2 - .Cells(i * 15 + j, 2).Value = 0 Then
Cells(k, 1).Value = .Cells(i * 15 + 2, 1).Value '日期
Cells(k, 3).Value = .Cells(i * 15 + 2, 6).Value '凭证号
Cells(k, 4).Value = .Cells(i * 15 + 3, 1).Value '摘要
Cells(k, 20).Value = .Cells(i * 15 + j, 4).Value '发出数量
k = k + 1: If k = 18 Then Exit Sub
End If
Next
Else
Exit For
End If
Next
End With
End Sub
附件:
手工进销表.zip
(27.04 KB, 下载次数: 53)
|
评分
-
1
查看全部评分
-
|