ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

¥i§_²¤Æ VBA »yªk

¥i§_²¤Æ VBA »yªk

¤j®a¦n¡A§Ú¼g¤@¦ê»yªk
¦ý¦Ûı±o¹Lµ{¤Ó¤¾ªø¡A¬O§_¥i¥H²¤Æµ{¦¡»yªk


±ø¥ó1.¦bAÄæ¦ì¡A¥u­n¥X²{¬O"ªÅ¥Õ"¡A´N¾ã¦C²¾°£
±ø¥ó2.¦bAÄæ¦ì¡A¥u­n¥X²{³o¨Ç­^¤å¡A´N¾ã¦C²¾°£ : TPD . TPD-both . TPD-viewing . GSA

Sub Step1()

On Error Resume Next
[A:A].SpecialCells(xlCellTypeBlanks).EntireRow.Delete
On Error GoTo 0
End Sub

Sub Step2()

Dim yy
yy = "TPD"
For I = [a65536].End(xlUp).Row To 1 Step -1
If WorksheetFunction.CountIf(Rows(I), yy) > 0 Then Rows(I).Delete
Next I
End Sub

Sub Step3()

Dim yy
yy = "TPD-both"
For I = [a65536].End(xlUp).Row To 1 Step -1
If WorksheetFunction.CountIf(Rows(I), yy) > 0 Then Rows(I).Delete
Next I
End Sub

Sub Step4()

Dim yy
yy = "TPD-viewing"
For I = [a65536].End(xlUp).Row To 1 Step -1
If WorksheetFunction.CountIf(Rows(I), yy) > 0 Then Rows(I).Delete
Next I
End Sub

Sub Step5()

Dim yy
yy = "GSA"
For I = [a65536].End(xlUp).Row To 1 Step -1
If WorksheetFunction.CountIf(Rows(I), yy) > 0 Then Rows(I).Delete
Next I
End Sub

¦b³Â·Ð¦U¦ì¥ý¶i!
Just do it.

¦^´_ 1# jsc0518


Try this:
  1. Sub zz()
  2. Application.ScreenUpdating = 0
  3. Dim x(), rng As Range, ar, Myr&
  4. x = Array("TPD", "TPD-both", "TPD-viewing", "GSA")
  5. Myr = [a65536].End(3).Row
  6. ar = Range("a1:a" & Myr)
  7. Set rng = Cells(Myr + 1, 1)
  8. For i = 1 To UBound(ar)
  9.     If Len(ar(i, 1)) = 0 Then
  10.         Set rng = Union(rng, Cells(i, 1))
  11.     Else
  12.         For j = 0 To UBound(x)
  13.             If InStr(ar(i, 1), x(j)) Then Set rng = Union(rng, Cells(i, 1))
  14.         Next
  15.     Next
  16. Next
  17. rng.EntireRow.Delete
  18. Application.ScreenUpdating = 1
  19. End Sub
½Æ»s¥N½X
hth
ikboy

TOP

  1. Sub ex()
  2.     For i = Cells(Rows.Count, 1).End(xlUp).Row To 1 Step -1
  3.         For Each x In Array("", "TPD", "TPD-both", "TPD-viewing", "GSA")
  4.             If Cells(i, 1) = x Then Cells(i, 1).EntireRow.Delete
  5.         Next
  6.     Next
  7. End Sub
½Æ»s¥N½X
{...} ªí¥Ü»Ý­n¥Î CTRL+SHIFT+ENTER ¤TÁä¿é¤J¤½¦¡

TOP

¦^´_ 2# ikboy

±z¦n¡A·PÁ¦^ÂСA¦ý¦b°õ¦æ¹Lµ{¤¤·|µo¥Í¿ù»~°T®§¡A¦p¤U¹Ï




028-01.zip (11.74 KB)

¦b³Â·Ð±z¤F!
Just do it.

TOP

¦^´_ 3# ML089

ML089
·PÁ±zªº´£¨Ñ¡A´ú¸Õ¦¨¥\¡AÁÂÁ±z!
Just do it.

TOP

¥»©«³Ì«á¥Ñ ­ã´£³¡ªL ©ó 2017-2-8 10:19 ½s¿è

­Y¥uÀˬd¢ÏÄ檺¤º®e¡A°Ñ¦Ò¦p¤U¡G
Sub zz2()
Dim T$, xR As Range, xE As Range
T = "_TPD_TPD-both_TPD-viewing_GSA_"¡@'±N¯Á¤Þ­È¥Î"_"³s±µ
Set xE = [A65536].End(xlUp)(2)¡@'³]¢ÏÄæ³Ì«á¤@®æªº¤U¤@®æ¬° xE
For Each xR In Range([A1], xE(0))
¡@¡@If xR = "" Or InStr(T, "_" & xR & "_") Then Set xE = Union(xE, xR)
Next
xE.EntireRow.Delete
End Sub

¸ê®Æ¦hªº¸Ü¡AÀˬd§¹²¦¦A¤@¦¸§R¡A³t«×¸û§Ö¡ã¡ã

TOP

¦^´_ 4# jsc0518


Sorry ¨S´ú¸Õ, ¤v§ó¥¿:
Sub zz()
Application.ScreenUpdating = 0
Dim x(), rng As Range, ar, Myr&
x = Array("TPD", "TPD-both", "TPD-viewing", "GSA")
Myr = [a65536].End(3).Row
ar = Range("a1:a" & Myr)
Set rng = Cells(Myr + 1, 1)
For i = 1 To UBound(ar)
    If Len(ar(i, 1)) = 0 Then
        Set rng = Union(rng, Cells(i, 1))
    Else
        For j = 0 To UBound(x)
            If InStr(ar(i, 1), x(j)) Then Set rng = Union(rng, Cells(i, 1))
        Next
    End if
Next
rng.EntireRow.Delete
Application.ScreenUpdating = 1
End Sub

TOP

¦^´_ 7# ikboy


±z¦n¡A§Ú¦³´ú¸Õ¹L¡A¦ý¤´¦³¤@¨Ç°ÝÃD¡A­YAÄæ¬OªÅ¥Õªº(§Ú­n§R°£¦C)¡A¦ý¦bHÄ榳¸ê®Æ(§Ú¤£»Ý­n)
¸g´ú¸Õ«á¡A¥¦(HÄê)ªº¸ê®Æ¤´·|¦s¦b¡A¨Ã¤£·|¦]¬°AÄæ¬OªÅ¥Õ¦Ó§R°£¾ã¦C
Just do it.

TOP

¦^´_ 3# ML089

±z¦n¡A§Ú¦³´ú¸Õ¹L¡A¦ý¤´¦³¤@¨Ç°ÝÃD¡A­YAÄæ¬OªÅ¥Õªº(§Ú­n§R°£¦C)¡A¦ý¦bHÄ榳¸ê®Æ(§Ú¤£»Ý­n)
¸g´ú¸Õ«á¡A¥¦(HÄê)ªº¸ê®Æ¤´·|¦s¦b¡A¨Ã¤£·|¦]¬°AÄæ¬OªÅ¥Õ¦Ó§R°£¾ã¦C
Just do it.

TOP

¦^´_ 6# ­ã´£³¡ªL

±z¦n¡A§Ú¦³´ú¸Õ¹L¡A¦ý¤´¦³¤@¨Ç°ÝÃD¡A­YAÄæ¬OªÅ¥Õªº(§Ú­n§R°£¦C)¡A¦ý¦bHÄ榳¸ê®Æ(§Ú¤£»Ý­n)
¸g´ú¸Õ«á¡A¥¦(HÄê)ªº¸ê®Æ¤´·|¦s¦b¡A¨Ã¤£·|¦]¬°AÄæ¬OªÅ¥Õ¦Ó§R°£¾ã¦C
Just do it.

TOP

        ÀR«ä¦Û¦b : ¤£­n¤p¬Ý¦Û¤v¡A¦]¬°¤H¦³µL­­ªº¥i¯à¡C
ªð¦^¦Cªí ¤W¤@¥DÃD