- ©«¤l
- 4901
- ¥DÃD
- 44
- ºëµØ
- 24
- ¿n¤À
- 4916
- ÂI¦W
- 246
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Office 20xx
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_
- µù¥U®É¶¡
- 2010-4-30
- ³Ì«áµn¿ý
- 2024-11-12
|
¦^´_ 4# jcchiang - Sub ex()
-
- Dim Rng As Range, a, b As Range, c As Range
-
- With Sheet2
- r = 2
- Do Until .Cells(r, 1) = ""
- a = .Cells(r, 1)
- With Sheet1
- Set c = Nothing
- For Each b In .Range(.[A2], .[A65536].End(xlUp))
- If b = a Then
- If c Is Nothing Then
- Set c = b.MergeArea.Resize(, 6)
- Else
- Set c = Union(c, b.MergeArea.Resize(, 6))
- End If
- End If
- Next
- If Not c Is Nothing Then
- If Rng Is Nothing Then
- Set Rng = c
- Else
- Set Rng = Union(Rng, c)
- End If
- End If
- End With
- r = r + 1
- Loop
- End With
- With Sheet3
- .UsedRange.Offset(1).Clear
- Rng.Copy .[A2]
- End With
- End Sub
½Æ»s¥N½X |
|