¦U¦ì«e½ú¦n
¤µ¤Ñ½Ð±Ð©³¦â»P¦r¦âªº°ÝÃD
1.¥Ñ©ó¸û·sª©excelªº©³¦â¦r¦â³]©w¤ñ¸û¦h¼Ë©Ê!§Æ±æ¯à¦Û°ÊÅý©³¦â¦r¦â³]©w¦Û°Ê½Õ¾ã¤Ï®t©ö©óÃѧO
2.¥H¤U¥H Interior_ColorIndex ¤è¦¡ ªí¹FÃD·N!
3.½Ð±Ð¦U¦ì«e½ú¦³¤°»ò¤è¦¡¥i¥H Interior_Colorªº¤è¦¡³]©w©³¦â¤è¦¡,¤]¥i¥H¦Û°ÊÅý©³¦â¦r¦â³]©w¦Û°Ê½Õ¾ã¤Ï®t?
¦]¬°ÃC¦â¸¹ºØÃþ¤Ó¦h¤F! ¦³¤°»ò³W«h¥i´`¶Ü?
20221110.zip (56.09 KB)
ì©l¸ê®Æ:
Interior_ColorIndex ¤è¦¡µ²ªG:
Interior_Color¤è¦¡³]©w©³¦â .²`©³¦âªº¦rÁÙ¨SÅÜ¥Õ¦â:
Option Explicit
Sub Interior_ColorIndex()
Dim Arr, R&, C&, Sh, Brr, Crr, i&, x&, Y, T, Zn, N
Set Y = CreateObject("Scripting.Dictionary")
T = Timer
Set Sh = Sheets("¾Þ§@ªí")
R = Sh.UsedRange.EntireRow.Rows.Count
C = Sh.UsedRange.EntireColumn.Columns.Count
Arr = Range(Sh.[A1], Sh.Cells(R, C))
For i = 1 To R
Zn = Arr(i, 1)
If Y.Exists(Zn) = 0 Then
N = N + 1
Y(Zn) = N
End If
Sh.Cells(i, 1).Interior.ColorIndex = Y(Zn)
If InStr("/1/3/5/9/10/11/12/13/18/21/23/25/26/29/30/31/32/41/47/49/51/52/53/54/55/56/", "/" & Y(Zn) & "/") Then
Sh.Cells(i, 1).Font.ColorIndex = 2
End If
Next
End Sub
Option Explicit
Sub Interior_Color()
Dim Arr, R&, C&, Sh, Brr, Crr, i&, x&, Y, T, Zn, N
Set Y = CreateObject("Scripting.Dictionary")
T = Timer
Set Sh = Sheets("¾Þ§@ªí")
R = Sh.UsedRange.EntireRow.Rows.Count
C = Sh.UsedRange.EntireColumn.Columns.Count
Arr = Range(Sh.[A1], Sh.Cells(R, C))
For i = 1 To R
Zn = Arr(i, 1)
If Y.Exists(Zn) = 0 Then
N = N + 100000
Y(Zn) = N
End If
Sh.Cells(i, 1).Interior.Color = Y(Zn)
Next
End Sub |