| ©«¤l4901 ¥DÃD44 ºëµØ24 ¿n¤À4916 ÂI¦W267  §@·~¨t²ÎWindows 7 ³nÅ骩¥»Office 20xx ¾\ŪÅv150 ©Ê§O¨k ¨Ó¦Û¥x¥_ µù¥U®É¶¡2010-4-30 ³Ì«áµn¿ý2025-10-31 
                
 | 
                
| ¦^´_ 1# janejacky 
 
 ¸Õ¸Õªþ¥ó
 
  ¥X³f³æ¾ú¥v²Îp.rar (12.57 KB) ½Æ»s¥N½XSub inputdata() 'Àx¦s¸ê®Æ
Dim Rng As Range, Ay()
With Sheet1
Set Rng = .Range("A12:A29")
If Application.CountA(Rng) > 0 Then
   For Each a In Rng.SpecialCells(xlCellTypeConstants)
      ar = Array(.[G5].Value, .[G4].Value, .[B5].Value, a.Offset(, 1).Value, a.Offset(, 2).Value, a.Offset(, 3).Value, a.Offset(, 5).Value, a.Offset(, 6).Value)
      ReDim Preserve Ay(s)
      Ay(s) = ar
      s = s + 1
   Next
   cnt = .[G32].Value
   With Sheet2
      Set a = .[A65536].End(xlUp).Offset(1)
      a.Resize(s, 8) = Application.Transpose(Application.Transpose(Ay))
      a.Offset(s - 1, 8) = cnt
   End With
End If
End With
End Sub
Function PaperNo(Rng As Range, mydate As Date, k) '¬y¤ô½s¸¹
Set d = CreateObject("Scripting.Dictionary")
mystr = Format(mydate, "yyyymmdd")
If Application.CountA(Rng) > 0 Then
For Each a In Rng.SpecialCells(xlCellTypeConstants)
    If Left(a, 8) = mystr Then d(Val(a)) = ""
Next
End If
If d.Count > 0 Then
PaperNo = IIf(k = 1, Format(Application.Max(d.keys) + 1, "00000000000"), Format(Application.Max(d.keys), "00000000000"))
Else
PaperNo = mystr & "001"
End If
End Function
 | 
 |