Sub 提取数据()
票据清零
Set c = Cells.Find(what:="数据开始")
pzqsh = c.Row
Set d = Cells.Find(what:="数据结束")
pzzzh = d.Row
JL = 5
For I = pzqsh To pzzzh
If Range("E" & I).Value <> "" Then
Range("B" & I, "F" & I).Select
Selection.Copy
Range("B" & JL).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("G" & JL) = Range("D" & JL) * Range("E" & JL)
JL = JL + 1
Range("E" & I) = ""
End If
If JL >= 26 Then
Range("O3") = Range("O3") + 1
Exit Sub
End If
Next I
For I = pzqsh To pzzzh
If Range("G" & I).Value <> "" Then
Range("B" & I, "D" & I).Select
Selection.Copy
Range("B" & JL).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("E" & JL) = Range("G" & I) / Range("D" & I)
Range("F" & JL) = "箱"
Range("G" & JL) = Range("G" & I)
JL = JL + 1
Range("G" & I) = ""
End If
If JL >= 26 Then
Range("O3") = Range("O3") + 1
Exit Sub
End If
Next I
If JL <> 5 Then
Range("O3") = Range("O3") + 1
End If
Range("G3").Select
End Sub
Sub 票据清零()
'
' 票据清零 Macro
' 宏由 zhou 录制,时间: 2006-3-24
'
'
Range("B5:J25").Select
Selection.ClearContents
Range("a1").Select
End Sub