- ©«¤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
|
¥»©«³Ì«á¥Ñ GBKEE ©ó 2014-6-4 13:24 ½s¿è
¦^´_ 1# q1a2z5
¸Õ¸Õ¬Ý- Option Explicit
- Sub Ex()
- Dim Rng As Range, i As Integer, x As Integer, S As String
- Set Rng = Range("C4:H8") '½d³òÀx¦s®æ
- With Rng
- .Interior.ColorIndex = xlNone '²M°£Àx¦s®æªº¹Ï¥ÜÃC¦â
- .Font.ColorIndex = xlAutomatic '¦rÅ骺ÃC¦â¬°¦Û°Ê
- End With
- Do
- Randomize ' ¹ï¶Ã¼Æ²£¥Í¾¹°µªì©l¤Æªº°Ê§@¡C
- x = Int((Rng.Count - 1 + 1) * Rnd + 1) '1 ¨ì ½d³òÀx¦s®æ¼Æ¶¡ªºÀH¾÷¼Æ
- If InStr(S, Format(x, "00")) = 0 Then 'ÀH¾÷¼Æ¤£«½Æ
- S = S & Format(x, "00")
- With Rng(x) 'ÀH¾÷¼ÆÀx¦s®æ
- .Interior.Color = vbCyan
- .Font.Color = vbRed
- End With
- End If
- Loop Until Len(S) = 8 'ÀH¾÷¼Æ¹F4¦¸
- End Sub
½Æ»s¥N½X |
|