Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Remove rows where value = 0
H
I have 690 rows of information with one of the columns called "Feb 03". I would like all rows where the value in Feb 03 is "0" removed and the rows below to move up. There will be approx 250 rows removed. I could do this manually but I will need to be able to do this for future worksheets so a formula to speed up the process would be much appreciated Thanks in advanc Malcolm Davidson |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Remove rows where value = 0
Hi Malcolm
Try one of the examples on this page http://www.rondebruin.nl/delete.htm Post back if you need help -- Regards Ron de Bruin (Win XP Pro SP-1 XL2000-2003) www.rondebruin.nl "Malcolm" wrote in message ... Hi I have 690 rows of information with one of the columns called "Feb 03". I would like all rows where the value in Feb 03 is "0" removed and the rows below to move up. There will be approx 250 rows removed. I could do this manually but I will need to be able to do this for future worksheets so a formula to speed up the process would be much appreciated. Thanks in advance Malcolm Davidson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Remove rows where value = 0
Hi Malcolm
try the following code, which test for a zero in column A - starting in row 1 (change this according to your needs) Frank ---- Public Sub Deletezerorows() Dim R As Long Dim C As Range Dim Rng As Range On Error GoTo EndMacro Application.ScreenUpdating = False Application.Calculation = xlCalculationManual If Selection.Rows.Count 1 Then Set Rng = Selection Else Set Rng = ActiveSheet.UsedRange.Rows End If For R = Rng.Rows.Count To 1 Step -1 If Cells(R, 1).Value = 0 Then 'look in column A then Rng.Rows(R).EntireRow.Delete End If Next R EndMacro: Application.ScreenUpdating = True Application.Calculation = xlCalculationAutomatic End Sub Malcolm wrote: Hi I have 690 rows of information with one of the columns called "Feb 03". I would like all rows where the value in Feb 03 is "0" removed and the rows below to move up. There will be approx 250 rows removed. I could do this manually but I will need to be able to do this for future worksheets so a formula to speed up the process would be much appreciated. Thanks in advance Malcolm Davidson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Remove last n rows | Excel Worksheet Functions | |||
remove rows in one sheet from similar rows in another | Excel Worksheet Functions | |||
How do I remove empty Rows | Excel Discussion (Misc queries) | |||
How to remove a lot of rows? Please help | Excel Discussion (Misc queries) | |||
How to remove rows for printing | Excel Discussion (Misc queries) |