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

[µo°Ý] Àx¦s®æµÛ¦â°ÝÃD

[µo°Ý] Àx¦s®æµÛ¦â°ÝÃD

¤j¤j¦n,
³sÄòÀx¦s®æµÛ¦â,³q±`³£¤£·|¦³ªÅ»Ø,½Ð°Ý­n«ç»ò°µ,¤~¯à¹³¥H¤U¹Ï¥Ü¯ëµÛ¦â¡H

¦^´_ 1# PJChen


    ÁÂÁ«e½úµoªí¦¹¥DÃD
«á¾ÇÂǦ¹©«¾Ç²ß¨ì«Ü¦hª¾ÃÑ»P¸gÅç,¥H¤Uµ{¦¡½X½Ð¸Õ¸Õ¬Ý¬O§_²Å¦X»Ý¨D

°õ¦æµ²ªG:


Option Explicit
Sub TEST_20221226_1()
Dim Area, T
T = [{"¸ê²£","¬y°Ê¸ê²£:","²{ª÷","À³¦¬²¼¾Ú","À³¦¬±b´Ú","¦s³f","¹w¥I´Ú¶µ","¨ä¥LÀ³¦¬´Ú","¨ä¥L¬y°Ê¸ê²£","¬y°Ê¸ê²£Á`­p"}]
T = Application.Transpose(T)
Workbooks.Add
Set Area = [D2:E15]
With Area
   .Font.Name = "·L³n¥¿¶ÂÅé"
   .Font.ColorIndex = 49
   .HorizontalAlignment = xlLeft
   .VerticalAlignment = xlTop
   .Borders(xlInsideHorizontal).LineStyle = xlContinuous
   .Borders(xlInsideHorizontal).ThemeColor = 1
   .Item(1).ColumnWidth = 20
   .Item(2).ColumnWidth = 16
   .Interior.ColorIndex = 2
   .Item(5).Resize(2, 2).Interior.ColorIndex = 49
   .Item(5).Resize(2, 2).Merge
   .Item(11).Resize(8, 2).Interior.ColorIndex = 37
   .Item(1) = "¤½¥q¦WºÙ"
   .Item(1).Font.Size = 16
   .Item(3) = "2022/3/31"
   .Item(3).NumberFormatLocal = "¤é´Á:yyyy.mm.dd"
   .Item(5) = "¸ê²£­t¶Åªí"
   .Item(5).Font.ColorIndex = 2
   .Item(14, 1).Resize(1, 2).Borders(xlEdgeTop).LineStyle = 1
   .Item(14, 1).Resize(1, 2).Borders(xlEdgeTop).Weight = 4
   .Item(14, 1).Resize(1, 2).Borders(xlEdgeTop).ThemeColor = 2
   .Item(14, 1).Font.Bold = True
   .Item(1).Font.Bold = True
   .Item(9).Font.Bold = True
   .Item(5, 1).Resize(10) = T
End With
End Sub
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

¦^´_ 2# Andy2483

±z¦n,

­ì¨Ó¬O¥Îµ{¦¡½X¶Ü?
§Ú­ì¥H¬°¬O³]©wªº°ÝÃD©O¡I
ÁÂÁ±z

TOP

¦^´_ 1# PJChen

³o°ò¥»¤W¥i¥H¦b储¦s®æ¦¡°µ¨ì¡A§Ú¤£¥Î¥Õ¦â¦]¬Ý¤£¨ì

TOP

¥»©«³Ì«á¥Ñ Andy2483 ©ó 2022-12-27 13:52 ½s¿è

¦^´_ 3# PJChen


    ÁÂÁ«e½ú¦^´_
³o¨ÇÄݩʳ£¥i¥H¥Î¿ý»s¥¨¶°§Y¥i¨ú±o,¦]«á¾ÇÂǦ¹ÃD½m²ßVBA,¨Ã¥iÁYµu¬ã°Q¦¹¥DÃD±o¨ìµª®×,©Ò¥H«Øijª½±µ¥HVBA¤è®×

²LÂÅ©³¦â,Àx¦s®æ®æ¦¡®æ½u¿ï¶µ:


µ²ªG:


¥H¤U¬O«á¾Ç½m²ßVBA¤ß±oµù¸Ñ,½Ð°Ñ¦Ò
Option Explicit
Sub TEST_20221226_1()
Dim Area, T
'¡ô«Å§iÅܼÆ(Area,T)³£¬O³q¥Î«¬ÅܼÆ
T = [{"¸ê²£","¬y°Ê¸ê²£:","²{ª÷","À³¦¬²¼¾Ú","À³¦¬±b´Ú","¦s³f","¹w¥I´Ú¶µ","¨ä¥LÀ³¦¬´Ú","¨ä¥L¬y°Ê¸ê²£","¬y°Ê¸ê²£Á`­p"}]
'¡ô¥OT³o³q¥Î«¬ÅܼƬO 10­Ó¦r¦ê²Õ¦¨ªº°}¦C,¯Á¤Þ¸¹±q1¨ì10
T = Application.Transpose(T)
'¡ô¥OT³o³q¥Î«¬ÅܼƬO °}¦C¦Û¨­Âà¸m«áªº¤Gºû°}¦C
Workbooks.Add
'¡ô¥Oµ{§Ç²£¥Í¤@­Ó·s¬¡­¶Ã¯
Set Area = [D2:E15]
'¡ô¥OArea³o³q¥Î«¬ÅܼƬO ·s¬¡­¶Ã¯[D2:E15]Àx¦s®æ
With Area
'¡ô¥H¤U¬OÃö©óAreaÅܼƪº¬ÛÃöµ{§Ç
   .Font.Name = "·L³n¥¿¶ÂÅé"
   '¡ô¥O¦rÅé¦WºÙ¬O "·L³n¥¿¶ÂÅé"
   .Font.ColorIndex = 49
   '¡ô¥O¦r¦â¥N¸¹¬O 49
   .HorizontalAlignment = xlLeft
   '¡ô¥OÀx¦s®æ¤º®eÅã¥Ü¾a¥ª
   .VerticalAlignment = xlTop
   '¡ô¥OÀx¦s®æ¤º®eÅã¥Ü¾a¤W
   .Borders(xlInsideHorizontal).LineStyle = xlContinuous
   '¡ô¥O°Ï°ìÀx¦s®æ¤º³¡¤ô¥­®æ½u¬O¹ê½u
   'xlContinuous= 1 :  ³sÄò½u
   .Borders(xlInsideHorizontal).ThemeColor = 1
   '¡ô¥O°Ï°ìÀx¦s®æ¤º³¡¤ô¥­®æ½uÃC¦â¬O¥Õ¦â
   .Item(1).ColumnWidth = 20
   '¡ô¥O°Ï°ìÀx¦s®æ²Ä1®æªºÄæ¼e¬O 20
   .Item(2).ColumnWidth = 16
   '¡ô¥O°Ï°ìÀx¦s®æ²Ä2®æªºÄæ¼e¬O 16
   .Interior.ColorIndex = 2
   '¡ô¥O°Ï°ìÀx¦s®æ©³¦â¬O ¥Õ¦â
   .Item(5).Resize(2, 2).Interior.ColorIndex = 49
   '¡ô¥O°Ï°ìÀx¦s®æ²Ä5®æ(§t¦Û¨­)ÂX®i¦V¤U2¦C¦V¥k2Äæ°Ï°ìÀx¦s®æ,©³¦â¬OÂŦâ
   .Item(5).Resize(2, 2).Merge
   '¡ô¥O°Ï°ìÀx¦s®æ²Ä5®æ(§t¦Û¨­)ÂX®i¦V¤U2¦C¦V¥k2Äæ°Ï°ìÀx¦s®æ¦X¨Ö
   .Item(11).Resize(8, 2).Interior.ColorIndex = 37
   '¡ô¥O°Ï°ìÀx¦s®æ²Ä11®æ(§t¦Û¨­)ÂX®i¦V¤U8¦C¦V¥k2Äæ°Ï°ìÀx¦s®æ,©³¦â¬O²LÂŦâ
   .Item(1) = "¤½¥q¦WºÙ"
   '¡ô¥O°Ï°ìÀx¦s®æ²Ä1®æ­È¬O "¤½¥q¦WºÙ"¦r¦ê
   .Item(1).Font.Size = 16
   '¡ô¥O°Ï°ìÀx¦s®æ²Ä1®æ¦r¤j¤p¬O 16
   .Item(3) = "2022/3/31"
   '¡ô¥O°Ï°ìÀx¦s®æ²Ä3®æ­È¬O "2022/3/31"¦r¦ê
   .Item(3).NumberFormatLocal = "¤é´Á:yyyy.mm.dd"
   '¡ô¥O°Ï°ìÀx¦s®æ²Ä3®æ®æ¦¡¬O "¤é´Á:yyyy.mm.dd"
   .Item(5) = "¸ê²£­t¶Åªí"
   '¡ô¥O°Ï°ìÀx¦s®æ²Ä5®æ­È¬O "¸ê²£­t¶Åªí"¦r¦ê
   .Item(5).Font.ColorIndex = 2
   '¡ô¥O°Ï°ìÀx¦s®æ²Ä5®æ¦r¦â¬O ¥Õ¦â
   .Item(14, 1).Resize(1, 2).Borders(xlEdgeTop).Weight = 4
   '¡ô¥O°Ï°ìÀx¦s®æ 14¦C1ÄæÀx¦s®æÂX®i¦V¤U1¦C¦V¥k2Äæ°Ï°ìÀx¦s®æ,¨ä¤W¤è®æ½u­«¶q«Y¼Æ¬O4
   .Item(14, 1).Resize(1, 2).Borders(xlEdgeTop).ThemeColor = 2
   '¡ô¥O°Ï°ìÀx¦s®æ 14¦C1ÄæÀx¦s®æÂX®i¦V¤U1¦C¦V¥k2Äæ°Ï°ìÀx¦s®æÃC¦â¬O ¶Â¦â
   .Item(14, 1).Font.Bold = True
   '¡ô¥O°Ï°ìÀx¦s®æ 14¦C1ÄæÀx¦s®æ¦r¬O²ÊÅé
   .Item(1).Font.Bold = True
   '¡ô¥O°Ï°ìÀx¦s®æ²Ä1®æ¦r¬O²ÊÅé
   .Item(9).Font.Bold = True
   '¡ô¥O°Ï°ìÀx¦s®æ²Ä9®æ¦r¬O²ÊÅé
   .Item(5, 1).Resize(10, 1) = T
   '¡ô¥O°Ï°ìÀx¦s®æ 5¦C1ÄæÀx¦s®æÂX®i¦V¤U10¦C¦V¥k1Äæ°Ï°ìÀx¦s®æ­È,¥HT°}¦C±a¤J
End With
End Sub



Sub °}¦C»yªk´ú¸Õ()
Dim V, T, S, Z
V = Array("¸ê²£", "¬y°Ê¸ê²£:", "²{ª÷", "À³¦¬²¼¾Ú", "À³¦¬±b´Ú", "¦s³f", "¹w¥I´Ú¶µ", "¨ä¥LÀ³¦¬´Ú", "¨ä¥L¬y°Ê¸ê²£", "¬y°Ê¸ê²£Á`­p")
T = [{"¸ê²£","¬y°Ê¸ê²£:","²{ª÷","À³¦¬²¼¾Ú","À³¦¬±b´Ú","¦s³f","¹w¥I´Ú¶µ","¨ä¥LÀ³¦¬´Ú","¨ä¥L¬y°Ê¸ê²£","¬y°Ê¸ê²£Á`­p"}]
S = Split("¸ê²£,¬y°Ê¸ê²£:,²{ª÷,À³¦¬²¼¾Ú,À³¦¬±b´Ú,¦s³f,¹w¥I´Ú¶µ,¨ä¥LÀ³¦¬´Ú,¨ä¥L¬y°Ê¸ê²£,¬y°Ê¸ê²£Á`­p", ",")
Z = Application.Transpose(T)
'¡ô¥OT³o³q¥Î«¬ÅܼƬO °}¦C¦Û¨­Âà¸m«áªº¤Gºû°}¦C
MsgBox Z(2, 1)
MsgBox V(2) & "   " & T(2) & "   " & S(2)
MsgBox V(1) & "   " & T(1) & "   " & S(1)
MsgBox V(0) & "   " & T(0) & "   " & S(0)
End Sub

°»¿ù:
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

¦^´_ 5# Andy2483
¯u·PÁÂ,§A¦n¶K¤ß~~

TOP

¦^´_ 4# Emily
­ì¨Ó³o¼Ë´N¥i¥H²³æ¹F¦¨,·PÁÂ~~

TOP

        ÀR«ä¦Û¦b : §Ú­Ì­n°µ¦nªÀ·|ªºÀô«O¡A¤]­n°µ¦n¤º¤ßªºÀô«O¡C
ªð¦^¦Cªí ¤W¤@¥DÃD