Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
deleting values from a column
I have a column of values and from time to time I have “0”. How can
erase these values of “0” but without leaving blank cells in the colum and thus get a column with only the positive values in also in the sam order? I would like to know if there is a macro for this!? Dan -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
deleting values from a column
Hi
Try this one for column A Sub Example1() Dim Firstrow As Long Dim Lastrow As Long Dim Lrow As Long Dim CalcMode As Long With Application CalcMode = .Calculation .Calculation = xlCalculationManual .ScreenUpdating = False End With Firstrow = ActiveSheet.UsedRange.Cells(1).Row Lastrow = ActiveSheet.UsedRange.Rows.Count + Firstrow - 1 With ActiveSheet .DisplayPageBreaks = False For Lrow = Lastrow To Firstrow Step -1 If IsError(.Cells(Lrow, "A").Value) Then 'Do nothing, This avoid a error if there is a error in the cell ElseIf .Cells(Lrow, "A").Value = "0" Then .Rows(Lrow).Delete End If Next End With With Application .ScreenUpdating = True .Calculation = CalcMode End With End Sub More delete examples you find here http://www.rondebruin.nl/delete.htm -- Regards Ron de Bruin http://www.rondebruin.nl "cdanu " wrote in message ... I have a column of values and from time to time I have "0". How can I erase these values of "0" but without leaving blank cells in the column and thus get a column with only the positive values in also in the same order? I would like to know if there is a macro for this!? Dan --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Deleting values less than 100 | Excel Worksheet Functions | |||
Deleting Unique Values | Excel Discussion (Misc queries) | |||
Deleting rows based on column values | New Users to Excel | |||
deleting values in a worksheet without deleting the formulas | Excel Worksheet Functions | |||
Repeat values, deleting? | Charts and Charting in Excel |