Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 208
Default Deleting a row of data based upon the value in column D

Hi

I would like to delete all rows in my spreadsheet that have a null or non
numeric value in column D. Anyone know how to go about doing this ?

There is no header row in my spreadsheet.


Thanks in advance.
Sean
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Deleting a row of data based upon the value in column D

Hi
see:
http://www.xldynamic.com/source/xld.Deleting.html

"Sean" wrote:

Hi

I would like to delete all rows in my spreadsheet that have a null or non
numeric value in column D. Anyone know how to go about doing this ?

There is no header row in my spreadsheet.


Thanks in advance.
Sean

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 208
Default Deleting a row of data based upon the value in column D

Frank

I have taken a look at this page and it doesn't really help me. I have very
little skills in terms of coding so I am hoping for a bespoke response if at
all possible.

Regards
Sean

"Frank Kabel" wrote:

Hi
see:
http://www.xldynamic.com/source/xld.Deleting.html

"Sean" wrote:

Hi

I would like to delete all rows in my spreadsheet that have a null or non
numeric value in column D. Anyone know how to go about doing this ?

There is no header row in my spreadsheet.


Thanks in advance.
Sean

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Deleting a row of data based upon the value in column D

Hi
try the following
- use a helper column (e.g. column F):
- enter the following formula:
=IF(OR(D1="",NOT(ISNUMBER(D1))),"X","")
- copy this down for all rows
- use 'Data - Fiter - autofilter'
- Filter with this column and delete all rows containing 'X' in this helper
column
- remove the Autofilter

"Sean" wrote:

Frank

I have taken a look at this page and it doesn't really help me. I have very
little skills in terms of coding so I am hoping for a bespoke response if at
all possible.

Regards
Sean

"Frank Kabel" wrote:

Hi
see:
http://www.xldynamic.com/source/xld.Deleting.html

"Sean" wrote:

Hi

I would like to delete all rows in my spreadsheet that have a null or non
numeric value in column D. Anyone know how to go about doing this ?

There is no header row in my spreadsheet.


Thanks in advance.
Sean

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 208
Default Deleting a row of data based upon the value in column D

Frank

sorry to be a pain but is there not a way that i can avoid the manual side
of this ? My spreadhseet will vary in length and I just want a bit of code
that will assess all of the active rows and delete those that do not meet the
criteria.

I had a similar query recently but it revolved around column A. The coding
is below but I am not sure which parts to change:


'Deletes any rows that do not have numeric value in column A

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


Thanks
Sean


"Frank Kabel" wrote:

Hi
try the following
- use a helper column (e.g. column F):
- enter the following formula:
=IF(OR(D1="",NOT(ISNUMBER(D1))),"X","")
- copy this down for all rows
- use 'Data - Fiter - autofilter'
- Filter with this column and delete all rows containing 'X' in this helper
column
- remove the Autofilter

"Sean" wrote:

Frank

I have taken a look at this page and it doesn't really help me. I have very
little skills in terms of coding so I am hoping for a bespoke response if at
all possible.

Regards
Sean

"Frank Kabel" wrote:

Hi
see:
http://www.xldynamic.com/source/xld.Deleting.html

"Sean" wrote:

Hi

I would like to delete all rows in my spreadsheet that have a null or non
numeric value in column D. Anyone know how to go about doing this ?

There is no header row in my spreadsheet.


Thanks in advance.
Sean



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Deleting a row of data based upon the value in column D

What was wrong with yesterdays answer?

On Error Resume Next
columns(4).SpecialCells(xlConstants,xlTextValues). EntireRow.Delete
columns(4).SpecialCells(xlBlanks).EntireRow.Delete
On Error goto 0

If the values are produced by formulas you can use xlFormulas,xlTextValues

if you have error values
xlFormulas,xlErrors

or Logical

xlFormulas,xlLogical

See help on special cells for other options.

--
Regards,
Tom Ogilvy



"Sean" wrote in message
...
Frank

sorry to be a pain but is there not a way that i can avoid the manual side
of this ? My spreadhseet will vary in length and I just want a bit of

code
that will assess all of the active rows and delete those that do not meet

the
criteria.

I had a similar query recently but it revolved around column A. The

coding
is below but I am not sure which parts to change:


'Deletes any rows that do not have numeric value in column A

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


Thanks
Sean


"Frank Kabel" wrote:

Hi
try the following
- use a helper column (e.g. column F):
- enter the following formula:
=IF(OR(D1="",NOT(ISNUMBER(D1))),"X","")
- copy this down for all rows
- use 'Data - Fiter - autofilter'
- Filter with this column and delete all rows containing 'X' in this

helper
column
- remove the Autofilter

"Sean" wrote:

Frank

I have taken a look at this page and it doesn't really help me. I

have very
little skills in terms of coding so I am hoping for a bespoke response

if at
all possible.

Regards
Sean

"Frank Kabel" wrote:

Hi
see:
http://www.xldynamic.com/source/xld.Deleting.html

"Sean" wrote:

Hi

I would like to delete all rows in my spreadsheet that have a null

or non
numeric value in column D. Anyone know how to go about doing this

?

There is no header row in my spreadsheet.


Thanks in advance.
Sean



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleting rows based on column values Dazed and Confused[_2_] New Users to Excel 3 February 6th 09 10:47 PM
Deleting Rows based on Column Critieria blackmanofsteel40 Excel Discussion (Misc queries) 1 September 7th 07 09:05 PM
Deleting rows based upon the value in column D Sean Excel Programming 2 October 25th 04 08:59 PM
Deleting a row based on the value in column A Steve Excel Programming 2 September 30th 04 04:06 PM
Deleting a column based on a value Todd Huttenstine[_2_] Excel Programming 3 November 30th 03 03:17 AM


All times are GMT +1. The time now is 12:01 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"