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

[µo°Ý] ·j´M¡B¤ñ¹ï¡A¦A½Æ»s¹L¨Óªº¥\¯à

¥»©«³Ì«á¥Ñ n7822123 ©ó 2019-6-20 11:53 ½s¿è

¦^´_ 12# iceandy6150


²Ä¤G­Ó°ÝÃD  ²{¦b¬O6¤ë
§Ú¥t¦s·sÀÉ·Q­n¥Î¦~+¤ë+ÀɦW
¤ñ¦p  "10806ÀÉ®×"
108¥i¯àÁÙ¦n¡A´N Mid(year(Date),1,3) ´N±o¨ì¤F
¦ý¬O¤ë´N³Â·Ð¤F
¦pªG1~9¤ë¥u¦³¤@­Ó¼Æ¦r
10~12¤ë¬O¨â­Ó¼Æ¦r
¸Ó«ç»òÅýÀɦW¦Û°Ê¸É0 ©O?


¥Î®æ¦¡mm§Y¥i.............¦Û¤v¸Õ¸Õ¬Ý:
MsgBox Application.Text(Now, "m/d")
MsgBox Application.Text(Now, "mm/d"))



²Ä¤T­Ó°ÝÃD
µM«á¨ä¹ê§Ú·Q­n°µ¨ìªº¬O¥i¥H¦Û°Ê¦s¦¨¤U­Ó¤ëªº
¤ñ¦p²{¦b¬O¤»¤ë¡A¦ý¬O¦s°_¨Ó«o¬O "10807ÀÉ®×" ³o¼Ë

¤£¦h»¡.....¦Û¤v¸Õ¬Ý¬Ý:
MsgBox Application.Text(DateSerial(Year(Now), Month(Now) + 1, Day(Now)), "emm")

§AÀ³¸Ó­n¾Çªº¬O¡A¦³Ãö®É¶¡ªº¨ç¼Æ»P®æ¦¡
µ{¦¡¬O¨Ì»Ý¨D¼gªº¡A»Ý¨Dªí¹F¤£²M·¡
©ÎªÌ¨S¦³¤W¶Çªþ¥ó¡A·R²ö¯à§U

TOP

¦^´_ 13# iceandy6150

¦~¸ê??? ¥i¯à¦³¦p¤U±¡§Î???
1¦~3¤ë5¤é
1¦~5¤ë
1¦~12¤é
5¤ë18¤é
3¤ë
29¤é

TOP

¦^´_ 12# iceandy6150


    §Ú¦Û¤v§ä¨ì¸Ñ¨M¤èªk¤F¡A¯u¶}¤ß
¦pªGµ¹ªº¸ê®Æ¡A¬O¦³¦~¦³¤ë¡A¤ñ¦p 1¦~5¤ë³o¼Ë¡A´N¥Î¤@­Ó°µªk
¦pªGµ¹ªº¸ê®Æ¡A¥u¦³¤ë¨S¦³¦~¡A¤ñ¦p9¤ë¡B12¤ë¡A´N¥Î¥t¤@¿ìªk
³o¼Ë´N¯à§ï¦¨§Ú¦Û¤v­nªº 00¦~00¤ë ªº®æ¦¡¤F
  1.   c = .Range("D" & i).Value
  2.   
  3.   If c Like "*¦~*" Then  '¦³¦~¦³¤ë´N¥Î³o­Ó¤è¦¡§ï®æ¦¡

  4.    c = Application.Text(Replace(Replace(c, "¤ë", ":"), "¦~", ":"), "[hh]¦~mm¤ë")

  5.    Else
  6.    
  7.         f = Split(c, "¤ë")  '¦pªG¥u¦³¤ë  §PÂ_¬O¤@¦ì¼Æ(1~9¤ë)ÁÙ¬O¨â¦ì¼Æ(10~12¤ë)
  8.         
  9.         If Len(f(0)) = 1 Then
  10.            c = "00¦~0" & f(0) & "¤ë"
  11.         Else
  12.            c = "00¦~" & f(0) & "¤ë"
  13.         End If

  14.    End If
½Æ»s¥N½X
¬°¤°»ò­n°µ³o­Ó¥\¯à©O
¬O¦]¬°¨Ó·½¸ê®Æ«Ü¤£¤@©w
¦³®É­Ô¬O3¤ë  ¦³®É­Ô11¤ë  ¦³®É­Ô 1¦~5¤ë¡B10¦~11¤ëµ¥µ¥
¦ì¼ÆÅܨÓÅÜ¥h
¥ÎMID«ÜÃø©â¨ú

µM«á¤S­n®M¤W³W«h
¦pªGº¡¥b¦~´N«ç¼Ë«ç¼Ë---> ¥ýºâ¥X¦~¸ê´«ºâ¦¨¤ë¬O´X¤ë  º¡¥b¦~´N¬O¦~¸ê>=6
¦pªGº¡¤@¦~ --> ¦~¸ê>=12
¥Î³o¨Ç±ø¥ó¦A¨Ó°Ï¤À¦U¯Å¶Zªº¤H¸Ó¤U¤°»ò«ü¥O

¥H¤W¤p¤pµo²{¡A¦Û°Ý¦Ûµª
«¢Åo~¤j®a¦n§r

TOP

­É³o­Ó¥DÃD¦A½Ð°Ý¤@¤U

¤ñ¦p 1¦~2¤ë3¤é  ¸g¹Lµ{¦¡Âà¤Æ  ¥i¥HÅܦ¨ 01¦~02¤ë03¤é
¦ý¬O¦pªG¨Ó·½¥u¦³³Ñ¤U¤ë  ©Î¤é
¸Ó«ç»ò¿ì?  Âà¤Æ«á¦~¤ë³£¿ù¤F



²Ä¤G­Ó°ÝÃD  ²{¦b¬O6¤ë
§Ú¥t¦s·sÀÉ·Q­n¥Î¦~+¤ë+ÀɦW
¤ñ¦p  "10806ÀÉ®×"
108¥i¯àÁÙ¦n¡A´N Mid(year(Date),1,3) ´N±o¨ì¤F
¦ý¬O¤ë´N³Â·Ð¤F
¦pªG1~9¤ë¥u¦³¤@­Ó¼Æ¦r
10~12¤ë¬O¨â­Ó¼Æ¦r
¸Ó«ç»òÅýÀɦW¦Û°Ê¸É0 ©O?

²Ä¤T­Ó°ÝÃD
µM«á¨ä¹ê§Ú·Q­n°µ¨ìªº¬O¥i¥H¦Û°Ê¦s¦¨¤U­Ó¤ëªº
¤ñ¦p²{¦b¬O¤»¤ë¡A¦ý¬O¦s°_¨Ó«o¬O "10807ÀÉ®×" ³o¼Ë

¥H¤W°ÝÃD¦Aµo°Ý¡AÁÂÁÂ




¬¡­¶Ã¯1.rar (16.33 KB)
«¢Åo~¤j®a¦n§r

TOP

¦^´_ 10# ­ã´£³¡ªL


    ·PÁ¤j¤j´£¨Ñ¥t¤@§@ªk
    §Ú·|¦A¸Õ¸Õ¬Ýªº

   ¤µ¤Ñ¤ñ¸û¦³ªÅ¡A§Ú®³¥Õ¯ÈºCºCµe¡A²×©ó·dÀ´ KUBI¤j¤j¬°¤°»ò¯à¤£¥Î §PÂ_¦¡¨Ó°µ¤F
   ¦]¬°Ãþ¦ü¯Á¤Þªº¤è¦¡¡Aµe¤F§Ö30¤ÀÄÁ~ ¸Ñ¶}Á¼¹Î¤F(¶}¤ß~)
   
  ­ì¨Ó´N¬O¥ý§â©Ò¦³ªº°t¹ï¤èªk³£°O¿ý°_¨Ó¦b d ¸Ì­±
   0001+©m¦W  ´N¬O  ¤ý¤p©ú
   0001+¯Z¯Å  ´N¬O XXX
   ¥H¦¹Ãþ±À
  
   ¤§«á¨ìµ²ªG¨ºÃä¡A¦pªG§Ú­nªº¬O0002¡B0003¡AµM«á¼ÐÃD§Ú­nªº¬O©m¦W ¸ò Åé­«
   ¨º»ò0002+©m¦W ¥H¤Î 0002+Åé­« ¥H¤Î 0003+©m¦W  ¥H¤Î 0003+Åé­«
   ³£¥i¥H±q d¸Ì­±¥h§ä¨ì¤W­±¥|­Ó¬Û¹ïÀ³ªº­È
   µM«á¥¿½TÅã¥Ü¥X¨Ó

  ©Ò¥H¤£ºÞ§Úµ²ªG¨ºÃä§ï¦¨­n¥|ºØ¼ÐÃD  ¤ñ¦p©m¦W¡B¯Z¯Å¡B³ß¦n¡BÅé­«
  ©Î¬O¥u§ï¦¨¤TºØ¼ÐÃD
  ¥u­n¾Ç¸¹+¼ÐÃD
  ³£¯à¥¿½T¦a±q d ¸Ì­±¥h¯Á¤Þ¨ì¬Û¹ïÀ³ªº­È
  Ãø©Ç¥i¥H¤£¥Î §PÂ_¦¡
  ¼F®`!!!

  ¥u¬O»¡¦pªG¸ê®Æ¦A§óÃe¤j¤@¨Ç¡A³oºØ¥þ¬ö¿ýªº¤è¦¡¡A·|¤£·|«Ü¯Ó°O¾ÐÅé
  (¦ý¥Ø«e¥H§Ú¨Ï¥Îªº¸ê®Æ¶q¡A³£ÁÙ¬O¨¬¥H¥¿±`¨Ï¥Î)
«¢Åo~¤j®a¦n§r

TOP

¦pªG¥u¬O²³æ¬d¸ß, ¸ê®Æ¤]¤£¦h, ¥i¥Î¤½¦¡:
Sub ¥¨¶°1()
P$ = ThisWorkbook.Path & "\"
With Range("D2", Cells(Rows.Count, 1).End(xlUp)(2, 2))
     .Columns(1) = "=VLOOKUP(A2,'" & P & "[¸ê®Æ.xlsx]¤u§@ªí1'!A:D,2,)"
     .Columns(3) = "=VLOOKUP(A2,'" & P & "[¸ê®Æ.xlsx]¤u§@ªí1'!A:D,4,)"
     .Columns(2) = "=VLOOKUP(A2,'" & P & "[¤Ø¤o.xlsx]¤u§@ªí1'!A:D,2,)"
     .Value = .Value
     .Replace "#N/A", ""
End With
End Sub

TOP

¦^´_ 8# GBKEE


    ÁÂÁÂ~ §Ú¦A¸Õ¸Õ

   ªì¨B¨Ï¥ÎÅܼƵøµ¡  ¬Oª¾¹D¥ý§â©Ò¦³¸ê®Æ©ñ¶i¤@­Ó¤j°}¦C

  µM«á¦A¥h²Ä¤G­ÓÀÉ®×¥´¶}

  ¦ý¬O¨S¦³ IF¨Ó°µ¤ñ¸û¡A«ç»òª¾¹D²Ä¤G­ÓÀÉ®×­n©ñ¤°»ò©O

¨Ï¥Î¿ý»s¥¨¶°­n«ç»ò¬Ý?  §âµ{¦¡½X¶K¶i¥h«ö¶s¹À? «ç»ò¬Ý¥¦¦Û¤v¤@¨B¤@¨B¶]?
«¢Åo~¤j®a¦n§r

TOP

¦^´_ 7# iceandy6150

±Æ§Çªº°ÝÃD,§A¥i¥Î¿ý»s¥¨¶°½m²ß¬Ý¬Ý
  1. Option Explicit
  2. Sub Ex()
  3.     Dim ar(), c As Integer, i As Integer
  4.     '**ReDim ³¯­z¦¡ ¦bµ{§Ç¼h¦¸¤¤¥Î¨Ó­«·s°t¸m°ÊºA°}¦CÅܼƪºÀx¦sªÅ¶¡¡C
  5.     ReDim ar(0 To 2)
  6.     For i = 0 To UBound(ar)
  7.         ar(i) = Chr(65) & i
  8.     Next
  9.     MsgBox UBound(ar) & vbLf & Join(ar, ",")
  10.     c = 8
  11.     ReDim ar(1 To c)
  12.     For i = 1 To UBound(ar) Step 2
  13.         ar(i) = Chr(66) & i
  14.     Next
  15.    
  16.     MsgBox UBound(ar) & vbLf & Join(ar, " , ")
  17.     ReDim Preserve ar(1 To c + 10)
  18.     '**  Preserve ¿ï¾Ü©Ê¤Þ¼Æ¡C·í§ïÅܭ즳°}¦C³Ì«á¤@ºûªº¤j¤p®É¡A¤´µM«O¦³­ì¨Óªº¸ê®ÆªºÃöÁä¦r
  19.     For i = c + 1 To UBound(ar) Step 3
  20.         ar(i) = i & Chr(67)
  21.    
  22.     Next
  23.     MsgBox UBound(ar) & vbLf & Join(ar, ",,")
  24.    
  25. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 6# GBKEE


    ·PÁ¤À¨É¥t¤@°µªk¡A¤µ¤Ñ§âK¤jªºµ{¦¡½X¦L¥X¨ÓºCºC¬Ý
    µo²{¡A¯uªº«Ü¯«©_¡A¬°¤°»ò³£¨S¦³¤ñ¹ïªºªF¦è¦b? ´N¥i¥H°µ¨ì®ÄªG?
    §Ú¤ß¸Ì­±°_ªì¤]¬O¦b·Q  À³¸Ó­n¥Î­Ó IF °Õ  FIND°Õ  ¤§Ãþªº
    ¤£µM«ç»òª¾¹D  "´ú¸Õ"ªº¾Ç¸¹  ¸ò¥t¥~¨â­ÓÀɮתº¾Ç¸¹  ¤@¤£¤@¼Ë
    ¤@¼Ë¤~½Æ»s  ¤£¤@¼Ë´N¤£½Æ»s
   
<¤@>K¤j©~µM¥Î¤T­Ó°j°é´N·d©w¤F¡A§ÚµLªk²z¸Ñ°Ú......(¤Ó°ª²`¤F)

   µM«á§Ú¤µ¤Ñ¦Û¤v¹Á¸Õ­n¼g¤@­Ó¤pµ{¦¡
   ±q"´ú¸Õ"¸Ì­±³]¤@«ö¶s  «ö¤U«á  ·|¶}¤@­ÓAÀÉ®×   ¦Û°Ê­pºâÀɮפ¤ªºBÄ榳´X¦C¸ê®Æ
   µM«á§Ú´N³]©w¤@­Ó°}¦C  ­n§âBÄ檺¸ê®Æ¨C¤@¦C¦s°_¨Ó

   °²³]BÄæ§PÂ_§¹¦³12µ§¸ê®Æ  §ÚªºÅܼÆc´Nµ¥©ó12
   ¦ý¬O§ÚDim Arry(1,c)  §Ú­n¤@ºû12®æªº°}¦C
   ´N¬O·|¥X¿ù  ¸ò§Ú»¡¤@©w­n±`¼Æ
   ¨º§Ú¥ý Dim Arry()   µM«á  c=1   «ü©wArry(1,c) = 10   ³o¼Ë¤]¿ù  (±Y¼ì....)

    <¤G>·Q¶¶«K½Ð±Ð  ¨ì©³­n«ç»ò³]©w°ÊºAªº°}¦C§r?

<¤T>³o¬O¤@­ÓÅܧΪº¤ñ¹ï»Ý¨D
¤ñ¹ïªº¶¶§Ç¦b  "¸ê®Æ"Àɮפ¤
¦ý¬O "´ú¸Õ"Àɮפ¤¡A¦]¬°¿é¤J»Ý­n¤ñ¹ïªº¾Ç¸¹¶i¨Ó¡A¤£¤@©w³£¬O¥Ñ¤p¨ì¤j
¥i¯à0005  ¦A¨Ó0001  ¦A¨Ó0003
¨º§Ú§Æ±æ¦b«ö¤U«ö¶s«á   ¯à¦Û°Ê±Æ¦¨0001  0003  0005ªº¶¶§Ç  §â¸ê®Æ©ñ¶i "´ú¸Õ"Àɮפ¤

¬Æ¦Ü  ¥D¯Á¤ÞÁä  ­Y¬O§ï¦¨¥H¦W¦r¨Ó·í¥D­n¹ï·Ó
´N¬O¦b"´ú¸Õ"Àɮפ¤    ¥u¦³¿é¤J  ¦W¦r   ¨S¦³¾Ç¸¹
¤@¼Ë¯à¥H "¸ê®Æ"Àɮפ¤ªº¶¶§Ç¨Ó±Æ
¨Ã½Æ»s¹L¨Ó "´ú¸Õ"Àɮ׸Ì

¦³¿ìªk¶Ü?

¥H¤W¡AÁÂÁÂ
«¢Åo~¤j®a¦n§r

TOP

¦^´_ 5# iceandy6150
VBAªº¥i¥Î¤£¦Pªº¼gªk,¨Ó¹F¨ì¦P¤@®ÄªG
  1. Option Explicit
  2. Private Sub CommandButton1_Click()
  3.     Dim Rng() As Range, Ar(), xR As Variant, xC As Variant, i As Integer, ii As Integer
  4.     Dim xRng As Range
  5.     Application.ScreenUpdating = False
  6.     Ar = Array("´ú¸Õ.XLSM", "¤Ø¤o.XLSX", "¸ê®Æ.XLSX")
  7.     ReDim Rng(UBound(Ar))       '** Rng ­«¸m¤¸¯À»P Ar ¤@¼Ë¦h
  8.     For i = 0 To UBound(Ar)
  9.         '**Workbooks(Ar(0)).Path ** ­×§ï¬° ¤Ø¤o , ¸ê®Æ Àɮתº¥¿½T¸ê®Æ§¨¦ì¸m**
  10.         If i > 0 Then Workbooks.Open (Workbooks(Ar(0)).Path & "\" & Ar(i)) '**¶}±ÒÀÉ®×
  11.         With Workbooks(Ar(i))
  12.             Set Rng(i) = .Sheets(1).Range("A1").CurrentRegion   '**³]©w­ÓÀɮתº¸ê®Æ½d³ò
  13.         End With
  14.     Next
  15.     With Rng(0)                         '**´ú¸Õ.XLSM ²M°£­n¾É¤J¸ê®Æªº½d³ò
  16.         .Range(.Cells(2, 2), .Cells(.Rows.Count, .Columns.Count)) = ""
  17.     End With
  18.     Set xRng = Rng(0).Cells(2, 1)       '**´ú¸Õ.XLSM: ²Ä¤@­Ó ¾Ç¸¹
  19.     Ar = Rng(0)                         '**´ú¸Õ.XLSM: ½d³ò¸ê®Æ¾É¤J°}¦C
  20.     Do While xRng <> ""                 '°j°é: ¾Ç¸¹ªº·j´M
  21.         For ii = 1 To UBound(Rng)
  22.             xR = Application.Match(xRng, Rng(ii).Columns(1), 0) '¤Ø¤o,¸ê®Æ ¤¤·j´M ¾Ç¸¹(ªº¦C¸¹)
  23.             If Not IsError(xR) Then                             '**·j´M¨ì ¾Ç¸¹(ªº¦C¸¹)
  24.                 For i = 2 To Rng(0).Rows(1).Cells.Count         '**´ú¸Õ Äæ¦ì¦WºÙ
  25.                     '**xC ¶Ç¦^¬O§_·j´M¨ì Äæ¦ì¦WºÙ
  26.                     xC = Application.Match(Rng(0).Cells(1, i), Rng(ii).Rows(1).Cells, 0)
  27.                     If Not IsError(xC) Then Ar(xRng.Row, i) = Rng(ii).Cells(xR, xC) '**¾É¤J¸ê®Æ¨ì°}¦C
  28.                 Next
  29.             End If
  30.         Next
  31.         Set xRng = xRng.Offset(1)           '**´ú¸Õ.XLSM: ¤U¤@­Ó ¾Ç¸¹
  32.     Loop
  33.     For i = 1 To UBound(Rng)
  34.         Rng(i).Parent.Parent.Close          '**Ãö³¬ "¤Ø¤o.XLSX", "¸ê®Æ.XLSX"
  35.     Next
  36.     Rng(0) = Ar                             '**°}¦C¸ê®Æ¾É¤J´ú¸Õ.XLSMªº½d³ò
  37.     Application.ScreenUpdating = True
  38. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : ¦³¤ß´N¦³ºÖ¡A¦³Ä@´N¦³¤O¡A¦Û³yºÖ¥Ð¡A¦Û±oºÖ½t¡C
ªð¦^¦Cªí ¤W¤@¥DÃD