- ©«¤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 ©ó 2015-9-15 09:35 ½s¿è
¦^´_ 2# citizen0923
¸Õ¸Õ¬Ý- Option Explicit
- Sub Ex()
- Dim Sh As Worksheet, xlWord As String, Ar(), xAr(), i As Integer, x As Integer
- xlWord = Sheets("¬d¸ß").Range("B1") 'n¬d¸ßªº½s¸¹
- For Each Sh In Sheets 'Sheets: ¬¡¶Ã¯ªº¤u§@ªíª«¥ó¶°¦X
- If Sh.Name <> "¬d¸ß" Then
- Ar = Sh.UsedRange.Value 'UsedRange(¤Gºû°}¦C): ¤u§@ªí¨Ï¥Îªº½d³ò
- For i = 1 To UBound(Ar)
- If UCase(Ar(i, 1)) = UCase(xlWord) Then
- ReDim Preserve xAr(x) '«¸m°}¦C¤¸¯Àªº¯Á¤ÞÈ,Preserve:«O¯d즳ªº¤¸¯À
- xAr(x) = Application.Index(Ar, i) 'Ū¨ú¤Gºû°}¦C¤¤¤¸¯À
- x = x + 1
- End If
- Next
- End If
- Next
- With Sheets("¬d¸ß").UsedRange.Offset(4) '³o½d³ò¤U²¾4¦Cªº½d³ò
- .Value = ""
- If x > 0 Then
- .Cells(1).Resize(x, UBound(Ar, 2)) = Application.Transpose(Application.Transpose(xAr))
- Application.Transpose'Âà¸m¨ç¼Æ
- End If
- MsgBox "¬d¸ß " & IIf(x = 0, "¤£¨ì ", "") & xlWord & IIf(x > 0, " OK!", "")
- End With
- End Sub
½Æ»s¥N½X |
|