Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi and thanks in advance.
I have a range from A1:A500. The cells have Yes and No...is there anyway to adjust my code to work? I'm trying to delete the rows that have cell value of no. Dim cl As String cl = "No" For Each cl In Range("a1:a500") SpecialCells(xlCellTypeBlanks).EntireRow.Delete Next cl thank you. Tim |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub Tester
dim rCell as Range For each rCell in range("A1:A500") if rCell.value="no" then rCell.Entirerow.Delete next rCell end sub HTH -- AP "Tim" a écrit dans le message de news: ... Hi and thanks in advance. I have a range from A1:A500. The cells have Yes and No...is there anyway to adjust my code to work? I'm trying to delete the rows that have cell value of no. Dim cl As String cl = "No" For Each cl In Range("a1:a500") SpecialCells(xlCellTypeBlanks).EntireRow.Delete Next cl thank you. Tim |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Ardus! Thank you very much, it's works perfectly :)
"Ardus Petus" wrote: Sub Tester dim rCell as Range For each rCell in range("A1:A500") if rCell.value="no" then rCell.Entirerow.Delete next rCell end sub HTH -- AP "Tim" a écrit dans le message de news: ... Hi and thanks in advance. I have a range from A1:A500. The cells have Yes and No...is there anyway to adjust my code to work? I'm trying to delete the rows that have cell value of no. Dim cl As String cl = "No" For Each cl In Range("a1:a500") SpecialCells(xlCellTypeBlanks).EntireRow.Delete Next cl thank you. Tim |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Tim
The code Ardus posted is not correct because you must loop from the bottom up when you delete rows. It will skip rows as it is now See http://www.rondebruin.nl/delete.htm -- Regards Ron De Bruin http://www.rondebruin.nl "Tim" wrote in message ... Hi Ardus! Thank you very much, it's works perfectly :) "Ardus Petus" wrote: Sub Tester dim rCell as Range For each rCell in range("A1:A500") if rCell.value="no" then rCell.Entirerow.Delete next rCell end sub HTH -- AP "Tim" a écrit dans le message de news: ... Hi and thanks in advance. I have a range from A1:A500. The cells have Yes and No...is there anyway to adjust my code to work? I'm trying to delete the rows that have cell value of no. Dim cl As String cl = "No" For Each cl In Range("a1:a500") SpecialCells(xlCellTypeBlanks).EntireRow.Delete Next cl thank you. Tim |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to delete rows with "-" in cell | Excel Discussion (Misc queries) | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
"Last Cell" to find last row, but can't delete blank rows | Excel Discussion (Misc queries) | |||
Search for the word "continued", if found, delete that row + 10 rows above | Excel Programming | |||
Search "Total" in all worksheets and delete rows containing "Total" | Excel Programming |