PDA

View Full Version : remove word



ashokbioinfo
03-01-2012, 02:15 AM
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

wakdafak
03-01-2012, 02:37 AM
try this


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

ashokbioinfo
03-01-2012, 02:50 AM
Hi,
I am not able to delete the row with that word, only particular word is deleted

wakdafak
03-01-2012, 02:58 AM
please check this http://www.rondebruin.nl/delete.htm

mdmackillop
03-01-2012, 06:40 AM
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