- ©«¤l
- 1018
- ¥DÃD
- 15
- ºëµØ
- 0
- ¿n¤À
- 1058
- ÂI¦W
- 0
- §@·~¨t²Î
- win7 32bit
- ³nÅ骩¥»
- Office 2016 64-bit
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ®ç¶é
- µù¥U®É¶¡
- 2012-5-9
- ³Ì«áµn¿ý
- 2022-9-28
|
¦^´_ 1# m077
¨S¤W¶Ç ... ¦Û¤v¸Õ¸Õ¦æ§_- Sub Test()
- Application.ScreenUpdating = False
- Application.EnableEvents = False
- Dim r As Long, i As Long
- Dim ar, rngCopy As Range
- With Workbooks("vbtest.xls")
- With .Sheets("sheet1")
- r = .Cells(.Rows.Count, "G").End(xlUp).Row
- ar = Application.Transpose(.Range(.Cells(1, 30), .Cells(r, 30)).Value)
-
- For i = 2 To r
- If ar(i) = "C2A4TST1" Then
- If rngCopy Is Nothing Then Set rngCopy = .Rows(i) Else Set rngCopy = Union(rngCopy, .Rows(i))
- End If
- Next
-
- .Select
- rngCopy.Copy .Sheets("sheet2").Range("A" & .Rows.Count).End(xlUp).Offset(1)
- .Sheets("sheet2").Select
- End With
- End With
- Set rngCopy = Nothing
- Application.EnableEvents = True
- Application.ScreenUpdating = True
- End Sub
½Æ»s¥N½X |
|