ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Remove rows where value = 0 (https://www.excelbanter.com/excel-programming/290896-remove-rows-where-value-%3D-0-a.html)

Malcolm

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

Ron de Bruin

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




Frank Kabel

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





All times are GMT +1. The time now is 12:26 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com