Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete rows with specific leftmost value
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete rows with specific leftmost value
Outstanding Mike...........your code works like a charm.........
Thank you very much! Vaya con Dios, Chuck, CABGx3 "Mike Fogleman" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Delete rows with specific text | New Users to Excel | |||
Delete Rows Without Specific Text | Excel Worksheet Functions | |||
Delete specific rows of data | New Users to Excel | |||
Delete rows if specific criteria not met. | Excel Worksheet Functions | |||
Macro to delete specific rows | Excel Programming |