- ©«¤l
- 2834
- ¥DÃD
- 10
- ºëµØ
- 0
- ¿n¤À
- 2890
- ÂI¦W
- 0
- §@·~¨t²Î
- ¡e²¤¡f
- ³nÅ骩¥»
- ¡e²¤¡f
- ¾\ŪÅv
- 100
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¡e²¤¡f
- µù¥U®É¶¡
- 2013-5-13
- ³Ì«áµn¿ý
- 2024-11-23
|
- Sub TEST()
- Dim R%, C&, xDate$, Arr, Brr, Crr, i&, j&, N&
- Dim xB As Workbook, xS As Worksheet, SS%
- R = Cells(Rows.Count, "D").End(xlUp).Row - 9 '¸ê®Æ¦C¼Æ(§t¼ÐÃD¦C)
- C = Cells(10, Columns.Count).End(xlToLeft).Column - 15 '(OrderÄæ¼Æ)
- If R <= 0 Or C <= 0 Then Exit Sub
- xDate = [G1] '¤é´Á
- Arr = [D10].Resize(R) '²£«~CODE
- Brr = [P10].Resize(R, C) 'Order¸ê®Æ°Ï
- Set xB = Workbooks.Add '¶}·sÀÉ®×
- For i = C To 1 Step -1
- If Brr(1, i) = "" Then GoTo 101
- Set xS = xB.Sheets.Add: xS.Name = Brr(1, i) '·s¼W¤u§@ªí
- xS.[C:C].ColumnWidth = 11 '¤é´ÁÄæ¼e
- N = 0: SS = SS + 1 '·s¼W¤u§@ªí²Öp±i¼Æ
- For j = 2 To R
- If Brr(j, i) <> "" Then
- N = N + 1
- xS.Cells(N, 1).Resize(1, 9) = Array("DK", "", "'" & xDate, "DN", "B99", Brr(1, i), Arr(j, 1), "", Brr(j, i))
- End If
- Next
- 101: Next i
- Application.DisplayAlerts = False
- If SS > 0 Then
- For i = xB.Sheets.Count To SS + 1 Step -1
- xB.Sheets(i).Delete '§R°£·sÀÉ®×¹w³]ªÅ¥Õ¤u§@ªí
- Next
- End If
- xB.SaveAs Filename:=ThisWorkbook.Path & "\©ú²Óªí_" & xDate & ".xls", CreateBackup:=False '¥t¦s·sÀÉ
- End Sub
½Æ»s¥N½X
Xl0000061.rar (16.85 KB)
|
|