Filehost.ro - gazduire fisiere
Mrrrr's Forum (VIEW ONLY)
Un forum care ofera solutii pentru unele probleme legate in general de PC. Pe langa solutii, aici puteti gasi si alte lucruri interesante // A forum that offers solutions to some PC related issues. Besides these, here you can find more interesting stuff.
Nou pe simpatie:
Ana Maria 25 pe Simpatie
Femeie
24 ani
Bucuresti
cauta Barbat
35 - 68 ani
Mrrrr's Forum (VIEW ONLY)ReguliInregistrareLoginPozeNu sunteti logat. Lista Forumurilor Pe Tematici
Mrrrr's Forum (VIEW ONLY) / Tutoriale si Ghiduri Utile // Tutorials and useful guides /

[EXCEL] Delete Rows That Contain Text [VBA]

Pagini: 1 Moderat de TRaP, TonyTzu
#1
TRaP
Moderator
Postari: 960
Delete rows from column A if cells contain the word "random"


Sub DeleteRowWithContents()

Application.ScreenUpdating = False
'========================================================================
' DELETES ALL ROWS FROM A2 DOWNWARDS WITH THE STRING "random" IN COLUMN A
'========================================================================
    Last = Cells(Rows.Count, "A").End(xlUp).Row
    For i = Last To 1 Step -1
        If InStr(Cells(i, "A").Value, "random") Then
    'Cells(i, "A").EntireRow.ClearContents ' USE THIS INSTEAD OF NEXT TO CLEAR CONTENTS BUT NOT DELETE ROW
            Cells(i, "A").EntireRow.Delete
        End If
    Next i
   
Application.ScreenUpdating = True
End Sub


 
   
Pagini: 1  
Mergi la