Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have a spreadsheet that in column 'C' there are times when the word
PENDING is in the cell instead of a date. I would like to have a macro that looks at each of these cell in COlumn 'C' and removes the entire row if the word PENDING in that cell. Thanks in advance |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
AutoFilter the word PENDING, then select all the PENDING rows, go to Edit
Delete Rows "Johnfli" wrote: I have a spreadsheet that in column 'C' there are times when the word PENDING is in the cell instead of a date. I would like to have a macro that looks at each of these cell in COlumn 'C' and removes the entire row if the word PENDING in that cell. Thanks in advance |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Public Sub DeleteCities()
Call DeleteByWord("PENDING") End Sub Sub DeleteByWord(ByVal strWord As String) Dim wks As Worksheet Dim rngToSearch As Range Dim rngFound As Range Dim rngFoundAll As Range Dim strFirstAddress As String Set wks = Sheets("Sheet1") 'Change This Set rngToSearch = wks.Columns("C") Set rngFound = rngToSearch.Find(What:=strWord , _ Lookat:=xlWhole, _ LookIn:=xlFormulas, _ MatchCase:=False) If Not rngFound Is Nothing Then Set rngFoundAll = rngFound strFirstAddress = rngFound.Address Do Set rngFoundAll = Union(rngFound, rngFoundAll) Set rngFound = rngToSearch.FindNext(rngFound) Loop Until rngFound.Address = strFirstAddress rngFoundAll.EntireRow.Delete End If End Sub -- HTH... Jim Thomlinson "Johnfli" wrote: I have a spreadsheet that in column 'C' there are times when the word PENDING is in the cell instead of a date. I would like to have a macro that looks at each of these cell in COlumn 'C' and removes the entire row if the word PENDING in that cell. Thanks in advance |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
easy way to delete all rows with no text in them? | New Users to Excel | |||
delete rows | Excel Discussion (Misc queries) | |||
Delete Rows where cells does not meet criteria | Excel Worksheet Functions | |||
Want to delete rows | Excel Discussion (Misc queries) | |||
How can we delete rows permanently from excel sheet | Excel Discussion (Misc queries) |