ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ³æ¸¹¦Û°Ê½s¸¹¥H"§ó·s·í¤é¤é´Á"«á¦Û°Ê¬y¤ô¸¹?

[µo°Ý] ³æ¸¹¦Û°Ê½s¸¹¥H"§ó·s·í¤é¤é´Á"«á¦Û°Ê¬y¤ô¸¹?

½Ð°Ýª©¤W«e½ú
§Ú¦³¤@¬qvba¼gªk, ¨ä¾P³f³æ³æ¸¹¼gªk¬O:
Sheets("¾P³f³æ").Select
Range("B5") = Format(Date, "emmdd") & "-" & Format(j, "0000") + 1
³æ¸¹:1050202-7
¬O¥Î¥Á°ê¦~¤ë¤é-¥[¤W¬y¤ô¸¹
¦ý¬O, ¹³¤W¨Ò¤ñ¦p·í¤é¦Û°Ê§Ç¸¹¨ì·í¤é¨Ï¥Îªº¬y¤ô¸¹....
¤ñ¦p¤µ¤é¬O105/02/04
­n«ç»ò¼g, ¥¦ªº³æ¸¹¦Û°Ê½s¸¹¤~¯à¥H"§ó·s·í¤é¤é´Á"«á¦Û°Ê¬y¤ô¸¹?

¥u­n¥[­Ó¤é´ÁÅܼƬö¿ý¤W¦¸°õ¦æ®Éªº¤é´Á,
¦Ó¦b¨C¦¸²£¥Í¬y¤ô¸¹«e¤ñ¹ï¨â¤é´Á­Y¤£¤@­Pªí¥Ü´«¤é,
¦¹®É¦A±N¬y¤ô¸¹Âk¹s§Y¥i.
  1.   Dim dDate As Date
  2.   Sheets("¾P³f³æ").Select
  3.   If dDate <> Date Then
  4.     j = 0
  5.     dDate = Date
  6.   End If
  7.   Range("B5") = Format(Date, "emmdd") & "-" & Format(j, "0000") + 1
½Æ»s¥N½X

TOP

¦^´_ 1# elaine688


    ³o­n¦^¥h°Q½×¸ê®Æ®w¡A¬Ý¬Ý§AÀx¦s´Xµ§·í¤é¸ê®Æ
µM«á¥H¸Ó¼Æ­È½á¤©µ{¦¡¤¤ªº j
Range("B5")= Format(Date, "emmdd-" & Format(j + 1, "000"))
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 1# elaine688
¥ç¥i¦p¦¹¡G
  1. Private Sub Workbook_Open()
  2.     If TimeValue(Now) >= "¤W¤È 08:45:00" Then [B1] = 1
  3. End Sub

  4. Sub Ex()
  5.     [A1] = SerialNo
  6.     [A2] = SerialNo
  7.     [A3] = SerialNo
  8. End Sub

  9. Function SerialNo() As String
  10.     Static cJ As Integer
  11.    
  12.     If [B1] = 1 Then cJ = 0
  13.     [B1] = 0
  14.     SerialNo = Format(Date, "emmdd") & "-" & Format(cJ + 1, "00000")
  15.     cJ = cJ + 1
  16. End Function
½Æ»s¥N½X

TOP

¥»©«³Ì«á¥Ñ ­ã´£³¡ªL ©ó 2016-2-9 13:36 ½s¿è

¾P³f³æ¸¹¦³¥H¤U°ÝÃD, ¥i¯à¶·¦Ò¼{¡G
¢°¡D¤é´Á¥i¯à¤£¬O·í¤Ñ¡Ä¨Ò¦p¡G¥ý¥H¤â¶}³æ¥X³f¡A¹j´X¤Ñ¸Éµn
¢±¡D©Î¦]Á{ªñ¤ëµ²¤é¡AÀ³«È¤á³W©w¶·­p¤J¤U¤ë±b¡A«h¶·¥H¸ó¤ë±b¤é´Á¿é¤J¡A
¡@¡@¨Ò¦p¡G¨C¤ë¤ëµ²¤é¬°¢±¢¯¤é¡A¦]«È¤á¥i¯à¢±¢°©Î¢±¢±¤é¤~¦¬¨ì³f¡A
¡@¡@¥»µ§³f´ÚÀ³­p¤J¤U¤ë±b¡A¬°¨ÏÀ³¦¬±b´Ú¤é´Á¤@­P¡A¥i¯à¶·±N¾P³f³æ¤é´Á§ï¬°¢±¢°¤é
¢²¡D¾P³f³æ¥i¯à¦³¬Y¨Ç­ì¦]¦Ó§R°£¡A³o·|²£¥Í¡e¸õ¸¹¡f¡A
¡@¡@­Y¶È¥H¤é´Á¥h­pºâµ§¼Æ¡A¦A¥H¡eµ§¼Æ¡f¥[¤@¡AÀ³ÁÙ¤£¬O³Ì¥¿½Tªº°µªk

³Ì¦n¯à¥H¡eFIND¡f¾P³f©ú²Ó¤¤¡e«ü©w¤é´Á¡DEMMDD]³Ì«á¤@µ§³æ¸¹¡A¥H¨ä¡e§Ç¸¹¡f¥[¤@¡I

°²³]¡G¢Ï¢±¬°¡e¾P³f¤é´Á¡f¡D¢Ï¢²¬°¡e¾P³f³æ¸¹¡f¡A¾P³f©ú²Ó¤u§@ªíªº¡e³æ¸¹¡f¦b¢ÐÄæ¡]¦³±Æ§Ç¡^
Dim DD&, xF As Range, S%
DD = Format([A2], "emmdd")
Set xF = [¾P³f©ú²Ó!B:B].Find(DD, SearchDirection:=xlPrevious)
If Not xF Is Nothing Then S = Right(xF, 3) + 1 Else S = 1
[A3] = DD & Format(S, "-000")

TOP

        ÀR«ä¦Û¦b : ¤@¥y·Å·xªº¸Ü¡A´N¹³©¹§O¤H¨­¤WÅx­»¤ô¡A¦Û¤v·|ªg¨ì¨â¤Tºw¡C
ªð¦^¦Cªí ¤W¤@¥DÃD