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

EXCEL ActiveX±±¨î«ö¶s ½Ð±Ð

¥»©«³Ì«á¥Ñ Andy2483 ©ó 2023-2-17 15:33 ½s¿è

¦^´_ 1# sschristy

ÁÂÁ«e½úµoªí¦¹¥DÃD
«á¾Ç¾Ç²ßªº«Øij¤è®×½d¨Ò¦p¤U:

1.¶}¤@­Ó·s¬¡­¶Ã¯
2.§â¤U¦Cµ{¦¡½X´Ó¤JVBA¼Ò²Õ¤¤°µ´ú¸Õ
2.1.¥ý°õ¦æ¶Ã¼Æ­«³]>>²£¥Í¸ê®Æ
2.2.¦A°õ¦æ¨âºØ¦X­p

Option Explicit
Sub EÄæ¦P©³¦â¦X­p_1()
Application.EnableEvents = False
Dim i&, C3&, C17&, T, C&
T = Timer
For i = 1 To Cells(Rows.Count, "E").End(3).Row
   C = Cells(i, "E").Interior.ColorIndex
   If C = 3 Then C3 = C3 + Val(Cells(i, "E"))
   If C = 17 Then C17 = C17 + Val(Cells(i, "E"))
Next
[B1] = C3: [A1].Interior.ColorIndex = 3
[B2] = C17: [A2].Interior.ColorIndex = 17
Application.EnableEvents = True
MsgBox Format(Timer - T, "0.00’")
End Sub

Sub EÄæ¦P©³¦â¦X­p_2()
Application.EnableEvents = False
Dim i&, C&, Y, Arr, T
T = Timer
Set Y = CreateObject("Scripting.Dictionary")
Arr = Range([E1], Cells(Rows.Count, "E").End(3))
For i = 1 To UBound(Arr)
   C = Cells(i, "E").Interior.ColorIndex
   Y(C) = Y(C) + Val(Arr(i, 1))
Next
[B1] = Y(3): [A1].Interior.ColorIndex = 3
[B2] = Y(17): [A2].Interior.ColorIndex = 17
Application.EnableEvents = True
MsgBox Format(Timer - T, "0.00’")
End Sub

Sub ¶Ã¼Æ­«³]()
Dim xArea, xR, R
Set xArea = [E1:E10000]
With xArea
   .Value = "=INT(RAND()*100)"
   .Value = .Value
   .Interior.ColorIndex = 17
End With
For Each xR In xArea
   If Int(Rnd() * 100) Mod 2 Then xR.Interior.ColorIndex = 3
Next
[B1:B2] = ""
End Sub

¶Ã¼Æ­«³]:


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

TOP

        ÀR«ä¦Û¦b : «Î¼e¤£¦p¤ß¼e¡C
ªð¦^¦Cªí ¤W¤@¥DÃD