- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¦^´_ 1# li_hsien
¸Õ¸Õ¬Ý- Option Explicit
- Sub ex()
- Dim Ar As Variant, e As Range, Rng As Range, T As Date
- Ar = Sheet2.[A5:A15].Value '¤u§@ïB
- Ar = Application.Transpose(Ar) 'Âà´«¬°¤@ºû°}¦C
- Ar = "," & Join(Ar, ",") & "," 'Join(¶Ç¦^¦r¦ê):¥H","¦r¦ê,³sµ²¤@ºû°}¦Cªº¤¸¯À¬°¦r¦ê
-
- For Each e In Sheet1.[A3:A10] '¤u§@ïA
- If InStr(Ar, "," & e & ",") Then '"," & e & "," => °ß¤@ªº¦r¦ê,Ar¤¤´M§ä³o"°ß¤@¦r¦ê"ªº¦ì¸m
- If Rng Is Nothing Then 'InStr(Ar, "," & e & ",")<>0 (False) => ¦³§ä¨ì³o"°ß¤@¦r¦ê"ªº¦ì¸m
- Set Rng = e
- Else
- Set Rng = Union(e, Rng)
- End If
- End If
- Next
- Rng.Parent.Activate '¤u§@ïA
- Rng.Interior.Color = vbRed
- T = Time
- Do
- DoEvents
- If Time - T > #12:00:01 AM# Then '¶¡¹j 1¬í
- T = Time
- If Rng.Interior.Color = vbRed Then
- Rng.Interior.Color = vbYellow
- Else
- Rng.Interior.Color = vbRed
- End If
- End If
- Loop
- End Sub
½Æ»s¥N½X |
|