Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I tried the following:
Range("U2:U" & LASTROW).FormulaR1C1 = "=IF(SEARCH(""pen"",RC[-2])0,2,IF(SEARCH(""can"",RC[-2])0,2,IF(SEARCH(""hol"",RC[-2])0,2,1)))" and this doesn't work either. Can you not do a multiple search?? I tried just putting one with both of the if statements and that doesn't work either. Any other suggestions? "Bricktop" wrote: I am trying to find all the cells in my worksheet that have "AB" in column 'I' and the AB is highlighted with an interior color = 6 .... then delete the row . Here is what I have so far. FIRSTROW = 1 Do While FIRSTROW 0 FIRSTROW = Application.Match("AB", Range("i:i"), 0) If Range("a" & FIRSTROW).Interior.ColorIndex = 6 Then Rows(FIRSTROW & ":" & FIRSTROW).Select Selection.Delete End If 'this is the part that is not working. What is happening is that when their is no match the code bombs so I tried to put an if statement in to change the firstrow to 0 if their is no match. But the if statement is not working. If FIRSTROW = Application.Match("AB", Range("i:i"), 0) Is Nothing Then FIRSTROW = 0 End If Loop |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
macro to keep specific name colomns and delete all others | Excel Discussion (Misc queries) | |||
Macro to delete rows containing specific data | New Users to Excel | |||
delete row contains specific word in an macro | Excel Discussion (Misc queries) | |||
Macro to delete specific rows | Excel Programming | |||
Warning Statement to Delete Macro | Excel Programming |