- ©«¤l
- 835
- ¥DÃD
- 6
- ºëµØ
- 0
- ¿n¤À
- 915
- ÂI¦W
- 15
- §@·~¨t²Î
- Win 10,7
- ³nÅ骩¥»
- 2019,2013,2003
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2010-5-3
- ³Ì«áµn¿ý
- 2024-11-12
|
Àµ½Ð¦U¦ì¤j¤jÀ°¦£½s¼g1Ó¯à¨Ì"¤pp"©M"Á`p"ªº¼ÐÃD¦Û°Ê§P§O¬q¸¨°Ï°ì½d³ò§@®æ¦¡³]©wªºµ{¦¡ÀÉ¡A
¥H§Q¯à¥H1´Ú ...
ziv976688 µoªí©ó 2020-12-25 07:31
´£¨Ñ¥t¥~¤@Ó¨¤«×ªº¼gªk :- Sub SetRng()
- Dim vColor()
- Dim lCol&(), lCols&, lRow&(), lRows&, lL1&, lL2&, lL3&
-
- ReDim lCol(5) ' ¤¦æ¥u¦³5Ó
- vColor = Array(0, 38, 4, 8)
- ' ----- ¨ú±o©Ò¦³ÃöÁäÄ渹»P¦C¸¹ -----
- lCol(1) = 2 ' ¨ú±o¤¦æ¤å¦r©Ò¦bÄ渹
- For lL1 = 2 To 5
- lCol(lL1) = Cells(1, lCol(lL1 - 1) + 1).End(xlToRight).Column
- Next
- lCols = Cells(2, Columns.Count).End(xlToLeft).Column ' ¦b²Ä2¦C§ä¸ê®Æ¥½Äæ
-
- lL1 = 3 ' ¨ú±o¤pp»PÁ`p©Ò¦b¦C¸¹
- ReDim lRow(0) ' °}¦Cªì©l¤Æ
- Do While Cells(lL1, 1) <> "Á`p"
- Do While Cells(lL1, 1) <> "¤pp" And Cells(lL1, 1) <> "Á`p"
- lL1 = lL1 + 1
- Loop
- If Cells(lL1, 1) <> "Á`p" Then ' ¤pp©Ò¦b¦C¸¹
- ReDim Preserve lRow(UBound(lRow) + 1)
- lRow(UBound(lRow)) = lL1
- lL1 = lL1 + 1
- Else
- lRows = lL1 ' Á`p©Ò¦b¦C¸¹
- End If
- Loop
-
- ' ----- ²M°£®æ¦¡³]©w»P®Ø½u -----
- With Range(Cells(3, 2), Cells(lRows, lCols)) ' ¸ê®Æ½d³ò
- .FormatConditions.Delete ' ²M°£©Ò¦³®æ¦¡³W«h
- For lL1 = 1 To 10 ' ²M°£®Ø½u³]©w
- .Borders(lL1).LineStyle = 0
- Next
- .Interior.Pattern = xlNone ' ²M°£©³¦â
- End With
- ' ----- ¶}©l®æ¦¡³]©w -----
- For lL1 = 2 To UBound(lCol) Step 2 ' ³]©w°¸¼Æ¬q¸¨
- With Range(Cells(3, lCol(lL1)), Cells(lRows, lCol(lL1 + 1) - 1))
- .Interior.ColorIndex = 34 ' ³]©w©³¦â
- For lL2 = 7 To 10 ' ³]©w¥~®Ø½u
- With .Borders(lL2)
- .LineStyle = 1
- .ColorIndex = 5
- .Weight = 4
- End With
- Next
- End With
- Next
-
- For lL1 = 1 To 4 ' ³]©w¹ï¨¤°Ï°ì©³¦â
- Range(Cells(lRow(lL1), lCol(lL1)), Cells(lRow(lL1), lCol(lL1 + 1) - 1)) _
- .Interior.ColorIndex = 36
- Next
- Range(Cells(lRow(5), lCol(5)), Cells(lRow(5), lCols)).Interior.ColorIndex = 36
-
- ReDim Preserve lCol(UBound(lCol) + 1) ' ÁY´îµ{¦¡½X,³o¸Ì°µÓ¨ú¥©°Ê§@,°t¦X°j°é§@·~
- lCol(UBound(lCol)) = lCols
-
- For lL1 = 1 To 5 ' ³]©w®æ¦¡¤Æ¤½¦¡
- For lL2 = 1 To UBound(lRow)
- For lL3 = 1 To 3
- With Range(Cells(lRow(lL2), lCol(lL1)), Cells(lRow(lL2), lCol(lL1 + 1) - 1))
- .FormatConditions.Add Type:=xlExpression, Formula1:= _
- "=" & Cells(lRow(lL2), lCol(lL1)).Address(0, 0) & "=LARGE(" & .Offset(0).Address & "," & lL3 & ")"
- .FormatConditions(.FormatConditions.Count).SetFirstPriority
- With .FormatConditions(1).Interior
- .PatternColorIndex = xlAutomatic
- .ColorIndex = vColor(lL3)
- .TintAndShade = 0
- End With
- .FormatConditions(1).StopIfTrue = True
- End With
- Next
- Next
- Next
- End Sub
½Æ»s¥N½X
®æ¦¡¤Æªº»yªk-a.zip (29.78 KB)
|
|