View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike Fogleman Mike Fogleman is offline
external usenet poster
 
Posts: 1,092
Default Delete rows with specific leftmost value

Put this in a general code module.

Sub DeleteRow()
Dim R As Long
Dim C As Range
Dim Rng As Range

Set Rng = ActiveSheet.UsedRange.Rows
For R = Rng.Rows.Count To 1 Step -1
Set C = Range("A" & R)
If Left(C, 7) = " SUPPL" Then
Rng.Rows(R).EntireRow.Delete
End If
Next R
End Sub

Mike F
"CLR" wrote in message
...
Hi All..........

I have a file that I am importing by macro and it comes in all in column
A........I know how to separate the columns with a SPACE delimiter, but
before doing that, I would like to delete all rows that begin with a
specific order of characters, (space space SUPPL), by having a macro read
column A and do the deletions.........if someone would be so
kind.............

TIA
Vaya con Dios,
Chuck, CABGx3