mardi 19 février 2019

Delete Row + Move up based on partial text match in a Column

I want a macro to delete any row that contains general in Column A and move up (to eliminate a blank row).

I have been attempting this but have been unsuccessful:

Sub format()
If Worksheets("Sheet1").Range("A1:A20").Value = "general" Then
Selection.Delete Shift:=xlToUp 
End If
End Sub

Sample Screenshot

Aucun commentaire:

Enregistrer un commentaire