In table I have to remove row with word 'esp' from column 5
emp 23 34 45 esp 11
chk 11 22 12 ntk 11
jkl 23 45 99 esp 22
In table I have to remove row with word 'esp' from column 5
emp 23 34 45 esp 11
chk 11 22 12 ntk 11
jkl 23 45 99 esp 22
try this
[VBA]
Sub deleteesp()
Application.DisplayAlerts = False
Dim sheetnum As Integer
Sheets("Sheet1").Select
With ActiveSheet
Lastrow_Track = .Cells(.Rows.Count, "O").End(xlUp).Row
End With
Sheets("Sheet1").Select
With ActiveSheet
Lastrow_CB_Err = .Cells(.Rows.Count, "A").End(xlUp).Row
End With
row_track = 1
For Row = 0 To 3
If Sheets("Sheet1").Cells(row_track, 5).Value Like "esp" Then
Sheets("Sheet1").Cells(row_track, 5).Value = " "
End If
row_track = row_track + 1
Next
End Sub
[/VBA]
Hi,
I am not able to delete the row with that word, only particular word is deleted
please check this http://www.rondebruin.nl/delete.htm
[VBA]Sub Test()
Dim i As Long
For i = Cells(Rows.Count, 5).End(xlUp).Row To 1 Step -1
If Cells(i, 5) = "esp" Then Cells(i, 5).EntireRow.Delete
Next
End Sub[/VBA]
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'