ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help required on a formula (https://www.excelbanter.com/excel-programming/372112-help-required-formula.html)

Gavin[_11_]

Help required on a formula
 
I import a large file which may have a few hundred rows.
in the rows there are the following
Zero value cell, Blank cell and numerical cells
I need to remove the cells that have a Zero value cell or are Blank.
Only the numerical cell need to remain

The starting cell is E7

So if E7 has a numerical value. move to E8 if numerical move to E9 etc.
if however there is a blank space or a zero the row needs to be
deleted.

Your help greatly appriciated

Thanks Gavin


DaveyJones

Help required on a formula
 

Sub Clrdata()
For i = 0 To 2000 '2000 if you have 2000 rows, 3000 for 3000 rows etc
Sheets("Sheet1").Select 'Sheet with info on
Cells(7 + i, 5).Select 'row 7, column E=5
If ActiveCell = "" Then Rows(7 + i).Delete Shift:=xlUp
If ActiveCell = "0" Then Rows(7 + i).Delete Shift:=xlUp
Next
End Sub
--
Dave


"Gavin" wrote:

I import a large file which may have a few hundred rows.
in the rows there are the following
Zero value cell, Blank cell and numerical cells
I need to remove the cells that have a Zero value cell or are Blank.
Only the numerical cell need to remain

The starting cell is E7

So if E7 has a numerical value. move to E8 if numerical move to E9 etc.
if however there is a blank space or a zero the row needs to be
deleted.

Your help greatly appriciated

Thanks Gavin



Richard M Burton

Help required on a formula
 
If you don't need to delete the rows you could try to 'autofilter' the list.

Then do a custom filter on the lines of ' is greater than' 0.



"Gavin" wrote:

I import a large file which may have a few hundred rows.
in the rows there are the following
Zero value cell, Blank cell and numerical cells
I need to remove the cells that have a Zero value cell or are Blank.
Only the numerical cell need to remain

The starting cell is E7

So if E7 has a numerical value. move to E8 if numerical move to E9 etc.
if however there is a blank space or a zero the row needs to be
deleted.

Your help greatly appriciated

Thanks Gavin




All times are GMT +1. The time now is 02:08 AM.

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