Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am trying to delete rows in my spreadsheet based upon
the value that appears in column A. I would like to delete the row only if it is NON numeric. Can this be done ? Thanks in advance. Steve |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Steve
Try this 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 Not IsNumeric(.Cells(Lrow, "A").Value) Then .Rows(Lrow).Delete End If Next End With With Application .ScreenUpdating = True .Calculation = CalcMode End With End Sub More info on this page http://www.rondebruin.nl/delete.htm -- Regards Ron de Bruin http://www.rondebruin.nl "Steve" wrote in message ... I am trying to delete rows in my spreadsheet based upon the value that appears in column A. I would like to delete the row only if it is NON numeric. Can this be done ? Thanks in advance. Steve |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
and again.
Steve -----Original Message----- Hi Steve Try this 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 Not IsNumeric(.Cells(Lrow, "A").Value) Then .Rows(Lrow).Delete End If Next End With With Application .ScreenUpdating = True .Calculation = CalcMode End With End Sub More info on this page http://www.rondebruin.nl/delete.htm -- Regards Ron de Bruin http://www.rondebruin.nl "Steve" wrote in message ... I am trying to delete rows in my spreadsheet based upon the value that appears in column A. I would like to delete the row only if it is NON numeric. Can this be done ? Thanks in advance. Steve . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Deleting rows based on column values | New Users to Excel | |||
Deleting Rows based on Column Critieria | Excel Discussion (Misc queries) | |||
Deleting columns based upon the value that appears in column A | Excel Programming | |||
Deleting Rows based on text in cell & formatting cell based on text in column beside it | Excel Programming | |||
Deleting a column based on a value | Excel Programming |