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

[µo°Ý] ¤£©w°Ï°ì¬q¸¨ªº®æ¦¡¤Æ»yªk¡C

¥»©«³Ì«á¥Ñ luhpro ©ó 2020-12-27 15:56 ½s¿è
¦^´_  luhpro
I ¤j : ±z¦n !
·PÁ±zªºÀ°¦£©M«ü¾É
´ú¸Õµ²ªG³ø§i :
¤j­ì«h"¦Û°Ê¤À¬q"¬OOKªº¡F ...
ziv976688 µoªí©ó 2020-12-26 16:26

±à...
Excel 2003 ·|¦³¿ù»~°Ú,
§Ú¦³³¡¤À«ü¥O¬O³z¹LExcel 2019 ¿ý»s¥¨¶°¥Í¦A°µ­×§ïªº.
³o¸Ì¥ý´£¨Ñ­×§ï«á¤ä´©¦h­Ó¤­¦æ¸ê®ÆªºÀÉ®×, (¦]¬°¤£²M·¡§Aªº¸ê®Æ¬O¦p¦óÂX®iªº, ½d¨ÒÀÉ´Nª½±µ§â­ìªí®æ¥ª¥k¤W¤U«þ¶K¼W¥[¤F)
·íµM,À³¸ÓÁÙ¬O·|µo¥Í­ì¥ý¦³ªº¿ù»~,
¥i¤ä´©2003ª©ªºÀÉ®×·|±ß¤@ÂI,
Office¤£¯à¦P®É¸Ë¨â®Mª©¥»,
»Ý­n§ï¥hÂÂPC´ú¤@¤U.

¥t¥~,­×§ï¤F¤@¨Ç¤pBUG,
ÁÙ¦³,¦]¬°¤§«e§â®榡¥þ³¡§R±¼¤F(¥]§tÁ`­p),
©Ò¥H¦A¼W¥[³]©wÁ`­p¦C®æ¦¡ªº³¡¤À:
  1. Sub SetRng()
  2.   Dim vColor()
  3.   Dim lCol&(), lCols&, lRow&(), lRows&, lL1&, lL2&, lL3&, ll4&

  4.   vColor = Array(0, 38, 4, 8)
  5.   lL1 = 2 ' ¨ú±o¤­¦æ©Ò¦bÄ渹
  6.   lCols = Cells(lL1, Columns.Count).End(xlToLeft).Column ' ¸ê®Æ¥½Äæ
  7.   ReDim lCol(0) ' °}¦Cªì©l¤Æ
  8.   Do While lL1 <= lCols
  9.     ReDim Preserve lCol(UBound(lCol) + 1)
  10.     lCol(UBound(lCol)) = lL1
  11.     lL1 = Cells(1, lL1).End(xlToRight).Column  ' §ä¤U­Ó¦³¸ê®ÆªºÄæ
  12.   Loop
  13.   
  14.   lL1 = 3 ' ¨ú±o¤p­p»PÁ`­p©Ò¦b¦C¸¹
  15.   ReDim lRow(0) ' °}¦Cªì©l¤Æ
  16.   Do While Cells(lL1, 1) <> "Á`­p"
  17.     Do While Cells(lL1, 1) <> "¤p­p" And Cells(lL1, 1) <> "Á`­p"
  18.       lL1 = lL1 + 1
  19.     Loop
  20.     If Cells(lL1, 1) <> "Á`­p" Then ' ¤p­p©Ò¦b¦C¸¹
  21.       ReDim Preserve lRow(UBound(lRow) + 1)
  22.       lRow(UBound(lRow)) = lL1
  23.       lL1 = lL1 + 1
  24.     Else
  25.       lRows = lL1 ' Á`­p©Ò¦b¦C¸¹
  26.     End If
  27.   Loop
  28.   
  29.   ' ----- ²M°£®æ¦¡³]©w»P®Ø½u -----
  30.   With Range(Cells(3, 2), Cells(lRows, lCols)) ' ¸ê®Æ½d³ò
  31.     .FormatConditions.Delete ' ²M°£©Ò¦³®æ¦¡³W«h
  32.     For lL1 = 1 To 10 ' ²M°£®Ø½u³]©w
  33.       .Borders(lL1).LineStyle = 0
  34.     Next
  35.     .Interior.Pattern = xlNone ' ²M°£©³¦â
  36.   End With
  37.   
  38.   For lL1 = 2 To UBound(lCol) Step 2 ' ³]©w°¸¼Æ¬q¸¨
  39.     With Range(Cells(3, lCol(lL1)), Cells(lRows, lCol(lL1 + 1) - 1))
  40.       .Interior.ColorIndex = 34 ' ³]©w©³¦â
  41.       For lL2 = 7 To 10 ' ³]©w¥~®Ø½u
  42.         With .Borders(lL2)
  43.           .LineStyle = 1
  44.           .ColorIndex = 5
  45.           .Weight = 4
  46.         End With
  47.       Next
  48.     End With
  49.   Next
  50.   
  51. On Error Resume Next ' µo¥Í¿ù»~¸õ¨ì¤U¤@¦æ«ü¥O,¨Ò¦p¶W¹L°}¦C¯Á¤Þ(³Ì«á¤@¦¸®É),¦C­Ó¼Æ¤p©ó¦æ­Ó¼Æ
  52.   For lL1 = 1 To UBound(lCol) ' ³]©w¹ï¨¤°Ï°ì©³¦â
  53.     Range(Cells(lRow(lL1), lCol(lL1)), Cells(lRow(lL1), lCol(lL1 + 1) - 1)) _
  54.         .Interior.ColorIndex = 36
  55.   Next
  56.   lL1 = lL1 - 1
  57.   Range(Cells(lRow(lL1), lCol(lL1)), Cells(lRow(lL1), lCols)).Interior.ColorIndex = 36
  58. On Error GoTo 0 ' µo¥Í¿ù»~¤¤Â_µ{¦¡¨ÃÅã¥Ü¿ù»~°T®§
  59.   
  60.   ReDim Preserve lCol(UBound(lCol) + 1) ' ÁY´îµ{¦¡½X,³o¸Ì°µ­Ó¨ú¥©°Ê§@,°t¦X°j°é§@·~
  61.   lCol(UBound(lCol)) = lCols
  62.   
  63.   ll4 = UBound(lCol) - 1 ' ´î¤Ö­pºâ¦¸¼Æ
  64.   For lL1 = 1 To ll4 ' ¤p­p¦C³]©w®æ¦¡¤Æ¤½¦¡
  65.     For lL2 = 1 To UBound(lRow)
  66.       For lL3 = 1 To 3
  67.         With Range(Cells(lRow(lL2), lCol(lL1)), Cells(lRow(lL2), _
  68.                      IIf(lL1 = ll4, lCols, lCol(lL1 + 1) - 1)))
  69.           .FormatConditions.Add Type:=xlExpression, Formula1:= _
  70.               "=" & Cells(lRow(lL2), lCol(lL1)).Address(0, 0) & _
  71.               "=LARGE(" & .Offset(0).Address & "," & lL3 & ")"
  72.           .FormatConditions(.FormatConditions.Count).SetFirstPriority
  73.           With .FormatConditions(1).Interior
  74.             .PatternColorIndex = xlAutomatic
  75.             .ColorIndex = vColor(lL3)
  76.             .TintAndShade = 0
  77.           End With
  78.           .FormatConditions(1).StopIfTrue = True
  79.         End With
  80.       Next
  81.     Next
  82.   Next
  83.   
  84.   For lL1 = 1 To ll4 ' Á`­p¦C³]©w®æ¦¡¤Æ¤½¦¡
  85.     If lL1 = ll4 Then
  86.       lL1 = lL1
  87.     End If
  88.     For lL3 = 1 To 3
  89.       With Range(Cells(lRows, lCol(lL1)), Cells(lRows, _
  90.                    IIf(lL1 = ll4, lCols, lCol(lL1 + 1) - 1)))
  91.         .FormatConditions.Add Type:=xlExpression, Formula1:= _
  92.             "=" & Cells(lRows, lCol(lL1)).Address(0, 0) & _
  93.             "=LARGE(" & .Offset(0).Address & "," & lL3 & ")"
  94.         .FormatConditions(.FormatConditions.Count).SetFirstPriority
  95.         With .FormatConditions(1).Interior
  96.           .PatternColorIndex = xlAutomatic
  97.           .ColorIndex = vColor(lL3)
  98.           .TintAndShade = 0
  99.         End With
  100.         .FormatConditions(1).StopIfTrue = True
  101.       End With
  102.     Next
  103.   Next
  104. End Sub
½Æ»s¥N½X
®æ¦¡¤Æªº»yªk-a2.zip (74.96 KB)

TOP

¦^´_  luhpro
I ¤j : ±z¦n !
·PÁ±zªºÀ°¦£©M«ü¾É
´ú¸Õµ²ªG³ø§i :
¤j­ì«h"¦Û°Ê¤À¬q"¬OOKªº¡F ...
ziv976688 µoªí©ó 2020-12-26 16:26

¶W¹L30¤ÀÄÁ.
­è­èµo²{·íªì¬°¤F¦w¸ËOffice2019¦³§âÂÂPCªºOffice²¾°£¤F, (§óÁV¿|ªº¬OWin7ÁÙ¤£¯à¦w¸ËOffice2109)
²{¦bÁ{®É§ä¤£¨ì·íªì¶Rªº¥]¸Ë§Ç¸¹. O.O
©Ò¥H¥u¯à¥ý¥H n7822123¤j¤j ´£¨Ñªºµ{¦¡¤ù¬q¨Ó­×§ï :
      For lL3 = 1 To 3
        With Range(Cells(lRow(lL2), lCol(lL1)), Cells(lRow(lL2), _
                     IIf(lL1 = ll4, lCols, lCol(lL1 + 1) - 1)))
          .FormatConditions.Add Type:=xlExpression, Formula1:= _
              "=" & Cells(lRow(lL2), lCol(lL1)).Address(0, 0) & _
              "=LARGE(" & .Offset(0).Address & "," & lL3 & ")".Interior.ColorIndex = vColor(lL3) ' <--- ¥[³o¬q
          '.FormatConditions(.FormatConditions.Count).SetFirstPriority ' ©³¤U³£§R±¼
          'With .FormatConditions(1).Interior
          '  .PatternColorIndex = xlAutomatic
          '  .ColorIndex = vColor(lL3)
          '  .TintAndShade = 0
          'End With
          '.FormatConditions(1).StopIfTrue = True

        End With
      Next
¨SÀô¹Ò¤£¯àÅçÃÒ,
¥u¦n½Ð§A¦Û¤v¸Õ¸Õ¬Ý¤F......

TOP

¥»©«³Ì«á¥Ñ ziv976688 ©ó 2020-12-27 19:57 ½s¿è

¦^´_ 11# luhpro
luhpro¤j¤j : ±z¦n !
°£¤F«e3¤j¼Ð¥Ü©³¦â¦]¦³»P2003ª©½Ä¬ð¤§¥~¡A¨ä¾l´ú¸Õ³£OK¤F
2003ª©ªº³¡¤À¡A²zÀ³¥Ñ¤p§Ì¦Û¤v¨Ó´ú¸Õ¡A¦p¦A¦³°ÝÃD¡A§Ú·|¦Û¦æ­×§ïªº¡C
¯u¬O¨¯­W±z¤F!ÁÂÁ±zªºµL¤ñ¼ö¤ßÀ°¦£©M­@¤ß«ü¾É~¤p§ÌÀò¯q¨}¦h~·P®¦*n¦¸

TOP

¥»©«³Ì«á¥Ñ luhpro ©ó 2020-12-27 22:07 ½s¿è
¦^´_  luhpro
luhpro¤j¤j : ±z¦n !
°£¤F«e3¤j¼Ð¥Ü©³¦â¦]¦³»P2003ª©½Ä¬ð¤§¥~¡A¨ä¾l´ú¸Õ³£OK¤F
...
ziv976688 µoªí©ó 2020-12-27 19:48

©êºp,¨S¹ê´úªGµMÁÙ¬O·|¥X¿ù, 12#ªºµ{¦¡¦³°ÝÃD, ¤§«eªºµ{¦¡¦b2003­n­×§ï¤@¤U:
          .FormatConditions.Add Type:=xlExpression, Formula1:= _
              "=" & Cells(lRow(lL2), lCol(lL1)).Address(0, 0) & _
              "=LARGE(" & .Offset(0).Address & "," & lL3 & ")"
          .FormatConditions(lL3)
.Interior.ColorIndex = vColor(lL3) ' <--- ¥[³o­Ó

¥t,¸g´ú¸Õ, ³]©w®æ¦¡®É­n¥ý Select ¦n§@¥Î°Ï¶ô, §_«h¤½¦¡·|¬O¿ù»~ªº.
¦A¥[¤W®æ¦¡³]©w¤¤µe­±·|¶Ã¸õ,
©Ò¥H§Ú¤]¥[¤F ScreenUpdating ±±¨î,
­×§ï«áµ{¦¡¦p¤U:
  1. Application.ScreenUpdating = False
  2.   ll4 = UBound(lCol) - 1 ' ´î¤Ö­pºâ¦¸¼Æ
  3.   For lL1 = 1 To ll4 ' ¤p­p¦C³]©w®æ¦¡¤Æ¤½¦¡
  4.     For lL2 = 1 To UBound(lRow)
  5.       For lL3 = 1 To 3
  6.         With Range(Cells(lRow(lL2), lCol(lL1)), Cells(lRow(lL2), _
  7.                      IIf(lL1 = ll4, lCols, lCol(lL1 + 1) - 1)))
  8.           .Select
  9.           .FormatConditions.Add Type:=xlExpression, Formula1:= _
  10.               "=" & Cells(lRow(lL2), lCol(lL1)).Address(0, 0) & _
  11.               "=LARGE(" & .Offset(0).Address & "," & lL3 & ")"
  12.           .FormatConditions(lL3).Interior.ColorIndex = vColor(lL3)
  13.           'With .FormatConditions(1).Interior
  14.           '  .PatternColorIndex = xlAutomatic
  15.           '  .ColorIndex = vColor(lL3)
  16.           '  .TintAndShade = 0
  17.           'End With
  18.           '.FormatConditions(1).StopIfTrue = True
  19.         End With
  20.       Next
  21.     Next
  22.   Next
  23.   
  24.   For lL1 = 1 To ll4 ' Á`­p¦C³]©w®æ¦¡¤Æ¤½¦¡
  25.     If lL1 = ll4 Then
  26.       lL1 = lL1
  27.     End If
  28.     For lL3 = 1 To 3
  29.       With Range(Cells(lRows, lCol(lL1)), Cells(lRows, _
  30.                    IIf(lL1 = ll4, lCols, lCol(lL1 + 1) - 1)))
  31.         .Select
  32.         .FormatConditions.Add Type:=xlExpression, Formula1:= _
  33.             "=" & Cells(lRows, lCol(lL1)).Address(0, 0) & _
  34.             "=LARGE(" & .Offset(0).Address & "," & lL3 & ")"
  35.         .FormatConditions(lL3).Interior.ColorIndex = vColor(lL3)
  36.         'With .FormatConditions(1).Interior
  37.         '  .PatternColorIndex = xlAutomatic
  38.         '  .ColorIndex = vColor(lL3)
  39.         '  .TintAndShade = 0
  40.         'End With
  41.         '.FormatConditions(1).StopIfTrue = True
  42.       End With
  43.     Next
  44.   Next
  45. Application.ScreenUpdating = True
½Æ»s¥N½X
®æ¦¡¤Æªº»yªk-a2-2003.zip (66.38 KB)

TOP

¦^´_ 14# luhpro
I¤j : ¦­¦w!
«e3¤j¼Ð¥Ü¤]OK¤F
¸U¤À·PÁ±z"Áæ¦Ó¤£±Ë"ªº¼ö¤ßÀ°¦£©M«ü¾É~·P®¦¦A·P®¦...............

TOP

¥»©«³Ì«á¥Ñ ziv976688 ©ó 2020-12-31 00:41 ½s¿è

¦^´_ 5# n7822123
¥¼©R¦W.png
2020-12-31 00:30

´ú¸ÕÀÉ :   ®æ¦¡¤Æªº»yªk-1231-¤­¦æ´ú¸Õ-Q.rar (32.11 KB)
n¤j : ±z¦n!
¤£¦n·N«ä
¥i§_½Ð±z¦AÀ°¦£¼g1­Ó¦³°_©l¦C(EX¡J191¦C)©M¨´¤î¦C(EX¡J199¦C)~¦]¬°³o­Ó³¡¤À¨C­Ó±Æ§Çªº°_¨´¦C¤§¦ì§}¤£¤@©w¬Û¦P~
¨Ã¯à¨Ì¾Ú²Ä1¦Cªº¤å¦r¦Û°Ê¤À¬qµe®Ø½u©M¼Ð¥Ü34¸¹©³¦â¤ÎÁ`­p¦C¤§«e3¤j¦U¼Ð¥Ü©³¦âªºVBA(EX¡J³]©w®æ¦¡B)?
¦]¬°§Ú¨S¦³¿ìªk¦Û¤v¥H³]©w®æ¦¡A¥h­×§ï
½Ð¸Ô¨£ªþ¥óA191¡JAX199
ÁÂÁ±z

TOP

¥»©«³Ì«á¥Ñ ziv976688 ©ó 2020-12-31 01:13 ½s¿è

¤£¦n·N«ä¡A´ú¸ÕÀɼҲÕ1ªºCall ³]©w®æB¡A½Ð§ï¬°³]©w®æ¦¡B
ÁÂÁÂ!

TOP

¦^´_ 17# ziv976688


§ï¦n¤F~¤]¤W¤Fµù¸Ñ

®æ¦¡¤Æªº»yªk-1231-¤­¦æ´ú¸Õ-Q.rar (35.12 KB)
µ{¦¡¬O¨Ì»Ý¨D¼gªº¡A»Ý¨Dªí¹F¤£²M·¡
©ÎªÌ¨S¦³¤W¶Çªþ¥ó¡A·R²ö¯à§U

TOP

¥»©«³Ì«á¥Ñ ziv976688 ©ó 2020-12-31 03:46 ½s¿è

¦^´_ 18# n7822123
n¤j : ±z¦n!
·PÁ±zªºµù¸Ñ¡A¨ü¯q¨}¦h~~~
¯u¬O¤Ó¼F®`¤F¡A°_¨´¦C¦b­þ¸Ì³£¾A¥Î(§tª÷±m539³£¥i¥H¥Î)¡A§Ú­ì¥ýÁÙ¦Û§@Áo©ú¡A±N [B3].Activate§ï¬° [B191](²{¦b¦³¦A§ï¦^[B3])~¯u©å
ÁÂÁ±zªº§Ö³t¦^ÂЩM­@¤ß«ü¾É~·P®¦(Áù°`)~~~~~

TOP

        ÀR«ä¦Û¦b : µêªÅ¦³ºÉ¡D§ÚÄ@µL½a¡AµoÄ@®e©ö¦æÄ@Ãø¡C
ªð¦^¦Cªí ¤W¤@¥DÃD