- ©«¤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
|
¦^´_ 6# yangjie
UBound(AR) °}¦C²Ä1ºûªº¤¸¯À¤W¯Á¤ÞÈ,
UBound(AR, 2) °}¦C²Ä2ºûªº¤¸¯À¤W¯Á¤ÞÈ- Option Explicit
- Sub EX()
- Dim d As Object, R As Range, S As String, AR(), i As Integer, ii As Integer
- Set d = CreateObject("scripting.dictionary") '³]¥ß¦r¨åª«¥ó
- If Application.CountA(Sheets("Sheet3").Cells) = 0 Then
- '3.Sheets("Sheet3").[a1].Resize(i + 1, UBound(AR, 2)) = AR ¦p¦óקאּ³Ì«á¤@¦C
- ReDim Preserve AR(i)
- AR(i) = Sheets("100¦hµ§").UsedRange.Cells(1).Resize(, 12).Value
- i = i + 1
- End If
- '1.¦]¬° Äæ¦ì¦³21Äæ¦ý§PŪ¬Û²§·Ç«h1~12Äæ copy¬O21Äæ,dictionary À³¦p¦ó¼g
- For Each R In Sheets("100¦hµ§").UsedRange.Columns(1).Resize(, 12).Rows
- S = Join(Application.Transpose(Application.Transpose(R.Value)), ",")
- '¬O§_¦³§ó¦n¤§¤è¦¡? Y¬O§PŪ¬Û²§·Ç«h¬°²Ä¤@²Ä¥|²Ä¤E²Ä¤QÄæ
- 'S = R.Cells(1, 1) & R.Cells(1, 4) & R.Cells(1, 9) & R.Cells(1, 10)
- 'S = R(1, 1) & R(1, 4) & R(1, 9) & R(1, 10)
- d(S) = ""
- Next
- For Each R In Sheets("1000¦hµ§").UsedRange.Columns(1).Resize(, 12).Rows
- S = Join(Application.Transpose(Application.Transpose(R.Value)), ",")
- 'S = R.Cells(1, 1) & R.Cells(1, 4) & R.Cells(1, 9) & R.Cells(1, 10)
-
- If d.exists(S) = False Then '¦r¨åª«¥óªºKey¤£¦s¦b
- 'If d(1).exists(S) = False Then '¦r¨åª«¥óªºKey¤£¦s¦b
- '2 ¨ä¤¤d(1)¬O¬Æ»ò? §Úªºµ§»~,쥻dn³]¬°°}¦C,
- ReDim Preserve AR(i)
- AR(i) = R.Value
- i = i + 1
- End If
- Next
- AR = Application.Transpose(Application.Transpose(AR))
- 'Sheets("Sheet3").[a1].Resize(i + 1, UBound(AR, 2)) = AR
- '3.Sheets("Sheet3").[a1].Resize(i + 1, UBound(AR, 2)) = AR ¦p¦óקאּ³Ì«á¤@¦C
- With Sheets("Sheet3")
- .Cells(.Rows.Count, "a").End(xlUp).Offset(Abs(Application.CountA(.Range("A:A")) > 1)).Resize(i, UBound(AR, 2)) = AR
- End With
- End Sub
½Æ»s¥N½X ¬°¦ón¨â¦¸Âà¸m
¦p¹Ï
|
|