- ©«¤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# boblovejoyce
§ì¨ú²Å¦X±ø¥óªº"²Ä¤@µ§", ¤£²M·¡§AªºÅÞ¿è ,¸Õ¸Õ¬Ý- Option Explicit
- Sub Ex()
- Dim Ar() As Variant, Ay() As Variant, i As Single, Msg As Variant
- With Sheet1
- Ar = .Range(.Cells(2, 10), .Cells(Rows.Count, 10).End(xlUp)) '°}¦C¤¸¯À¥ÑÀx¦s®æ¨ú±o¬°¤Gºû°}¦C
- Ar = Application.WorksheetFunction.Transpose(Ar) 'Âà¸m¬°¤@ºû°}¦C
- If Join(Ar, "") = "" Then 'Join ¨ç¼Æ ¶Ç¦^¤@Ó¦r¦ê¡A¸Ó¦r¦ê¬O³z¹L³sµ²¬YÓ°}¦C¤¤ªº¦hÓ¤l¦r¦ê¦Ó«Ø¥ßªº¡C
- MsgBox "¨S¸ê®Æ"
- Exit Sub
- End If
- ReDim Ay(1 To UBound(Ar)) '¦PAr¤j¤pªº°}¦C
- For i = 1 To UBound(Ar)
- With .[A:A]
- 'After:=.Cells(.Cells.Count) ±q³Ì«á¤@ÓÀx¦s®æ
- If Not .Find(Ar(i), After:=.Cells(.Cells.Count), lookat:=xlPart) Is Nothing Then
- Ay(i) = .Find(Ar(i), After:=.Cells(.Cells.Count), lookat:=xlPart)
- Ay(i) = Right(Ay(i), Len(Ay(i)) - IIf(Len(Ay(i)) > 7, 7, 0))
- End If
- End With
- Next
- .Cells(2, 11).Resize(UBound(Ar), 1).Value = Application.WorksheetFunction.Transpose(Ay)
- '°}¦C¤¸¯À¥Ñ¥ª¦Ó¥k:¥Ñ¤W¦Ó¤U¶·Âà¸m
- End With
- End Sub
½Æ»s¥N½X |
|