- ©«¤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# chiang0320
¸Õ¸Õ¬Ý- Option Explicit
- 'Option Explicit ¬° ¦b¼Ò²Õ¼h¦¸¤¤±j¢¨CÓ¦b¼Ò²ÕùتºÅܼƳ£¥²¶·©ú½Tªº«Å§i¡C
- '³o¬O½s¼gµ{¦¡©ö©ó°»¿ùªº¦n²ßºD
- Sub Ex()
- Dim d As Object, E As Range, Ar(), T As Date
- T = Time
- Debug.Print "µ{¦¡¶}©l®É¶¡ : " & T '«ü¥O->À˵ø->§Y®É¹Bºâµøµ¡ : ¬d¬Ýµ{¦¡°_©l®É¶¡
- 'Dim i%= i As Integer
- 'Integer ¸ê®Æ«¬ºA Integer ÅܼƫY¥H½d³ò¬° -32,768 ¨ì 32,767 ¤§ 16 ¦ì¤¸ (2 Ӧ줸²Õ) ¼Æ¦rªº§Î¦¡Àx¦s¡CInteger ªº«¬ºA«Å§i¦r¤¸¬O¦Ê¤À¤ñ²Å¸¹(%
- '********** ¤£·|·¸¦ì ***********
- Dim i As Long '= i&
- 'Long ¸ê®Æ«¬ºA
- 'Long (ªø¾ã¼Æ)ÅܼƫY¥H½d³ò±q -2,147,483,648 ¨ì 2,147,483,647 ¤§ 32 ¦ì¤¸ (4 Ӧ줸²Õ) ¦³¸¹¼Æ¦r§Î¦¡Àx¦s¡CLong ªº«¬ºA«Å§i¦r¤¸¬° &¡C '
- Set d = CreateObject("scripting.dictionary") '¦r¨åª«¥ó
- With Sheets("p10")
- For Each E In .Range(.[a1], .[a1].End(xlDown))
- d(E.Value) = Array(E.Offset(, 2), E.Offset(, 3))
- 'e.Value > ¦r¨åª«¥óªºÃöÁä¦r(key) ¾É¤J Array(e.Offset(, 2), e.Offset(, 3))
- Next
- End With
- With Sheets("q72").Range(Sheets("q72").[B2], Sheets("q72").[B2].End(xlDown)).Resize(, 4)
- Ar = .Value
- For i = 1 To UBound(Ar)
- If d.exists(Ar(i, 1)) Then
- 'Exists ¤èªk ¦pªG¦b Dictionary ª«¥ó¤¤«ü©wªºÃöÁä¦r¦s¦b¡A¶Ç¦^ True¡AY¤£¦s¦b¡A¶Ç¦^ False¡C
- Ar(i, 3) = d(Ar(i, 1))(0)
- Ar(i, 4) = d(Ar(i, 1))(1)
- Else
- Ar(i, 3) = "µL¸ê®Æ"
- Ar(i, 4) = "µL¸ê®Æ"
- End If
- Next
- .Value = Ar
- End With
- Debug.Print "µ{¦¡µ²§ô®É¶¡ : " & Time, Application.Text(Time - T, "¦@p[S]¬í")
- '«ü¥O->À˵ø->§Y®É¹Bºâµøµ¡ : ¬d¬Ýµ{¦¡¹B¦æ³t«×
- End Sub
½Æ»s¥N½X |
|