FireRulerX
New Member
- Joined
- Aug 10, 2010
- Messages
- 5
Here is the code I am using but can not make it viable to a specifc column.
Sub Delete_Rows()
' This macro deletes all rows on the active worksheet
' that do not have Versaold in column F.
Dim Rng As Range, cell As Range, del As Range
Dim strCellValue As String
Set Rng = Intersect(Range("F2:F1000"), ActiveSheet.UsedRange)
For Each cell In Rng
strCellValue = (cell.Value)
If InStr(strCellValue, "VERSACOLD") > 0 Then
If del Is Nothing Then
Set del = cell
Else: Set del = Union(del, cell)
End If
End If
Next cell
On Error Resume Next
del.EntireRow.DELETE
End Sub
Thanks A lot
Sub Delete_Rows()
' This macro deletes all rows on the active worksheet
' that do not have Versaold in column F.
Dim Rng As Range, cell As Range, del As Range
Dim strCellValue As String
Set Rng = Intersect(Range("F2:F1000"), ActiveSheet.UsedRange)
For Each cell In Rng
strCellValue = (cell.Value)
If InStr(strCellValue, "VERSACOLD") > 0 Then
If del Is Nothing Then
Set del = cell
Else: Set del = Union(del, cell)
End If
End If
Next cell
On Error Resume Next
del.EntireRow.DELETE
End Sub
Thanks A lot