7,763
社区成员
发帖
与我相关
我的任务
分享
'' 生成具体表
''--------------------------------
Sub InitTableStyle(PONo As String, rowno As Integer, Index As Integer, LabelCount As Integer, StartRow As Integer, EndRow As Integer, StartCol As Integer, EndCol As Integer)
Dim barboxqty As String 'Barcode的Boxqty
Dim barcode As String, barpo As String
Dim pack As String 'Barcode号
Dim packnum As String 'Barcode的捆包个数
Dim i As Integer, j As Integer
Dim strpo As String, strcostomno As String, strcostomname As String, strboxqty As Integer, strqty As Integer, strpacknum As String
Dim strpartno As String, strorg As String, datefob As String, dateissue As String
Dim iQty As Integer, iBoxQty As Integer, iModQty As Integer
iQty = CInt(Worksheets("Input").Cells(rowno, 2))
iBoxQty = CInt(Worksheets("Input").Cells(rowno, 3))
If iQty Mod iBoxQty > 0 Then
iModQty = iQty Mod iBoxQty
Else
iModQty = 0
End If
strpo = Worksheets("Input").Cells(rowno, 1)
strcostomno = Worksheets("Input").Cells(1, 2)
strcostomname = Worksheets("Input").Cells(1, 4)
If iModQty = 0 Or Index < LabelCount Then
strboxqty = Worksheets("Input").Cells(rowno, 3)
Else
strboxqty = iModQty
End If
strqty = Worksheets("Input").Cells(rowno, 2)
strpacknum = CStr(Index) & CStr(Chr(47)) & CStr(LabelCount)
strpartno = Worksheets("Input").Cells(rowno, 4)
strorg = Worksheets("Input").Cells(rowno, 5)
datefob = Worksheets("Input").Cells(rowno, 6)
dateissue = Worksheets("Input").Cells(rowno, 7)
barpo = CStr(strpo)
If Len(Trim(barpo)) < 12 Then
j = 12 - Len(Trim(barpo))
For i = 1 To j
barpo = barpo & " "
Next
End If
barboxqty = CStr(strboxqty)
If Len(Trim(strboxqty)) < 5 Then
j = 5 - Len(Trim(strboxqty))
For i = 1 To j
barboxqty = "0" & barboxqty
Next
End If
pack = CStr(Index)
If Len(Trim(Index)) < 2 Then
pack = "0" & CStr(Index)
End If
packnum = CStr(LabelCount)
If Len(Trim(LabelCount)) < 2 Then
packnum = "0" & LabelCount
End If