Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default Delete row if cell in column "E" has 1 or more alpha characters

I'm trying to delete rows of data after row 4 if the cell in column "E" has
any alpha characters in it at all. If the cell in column "E" is all numeric
then no action is taken on that row. Thoughts??
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default Delete row if cell in column "E" has 1 or more alpha character

This is probably OK with the OP but it does delete rows where the corr. col E
cell contains a string with only numbers. For example, it deletes a row with
'5 in the corresponding col. E cell.

--
Tushar Mehta
http://www.tushar-mehta.com
Custom business solutions leveraging a multi-disciplinary approach
In Excel 2007 double-click to format may not work; right click and select
from the menu


"Rick Rothstein" wrote:

Assuming you are running this code in the ActiveSheet (so that the Range is
referenced correctly), then this statement should do what you want...

Range("E5:E" & Rows.Count).SpecialCells(xlCellTypeConstants, _
xlTextValues).EntireRow.Delete

You can put it into a macro or execute it from the Immediate window.

--
Rick (MVP - Excel)


"Peruanos72" wrote in message
...
I'm trying to delete rows of data after row 4 if the cell in column "E"
has
any alpha characters in it at all. If the cell in column "E" is all
numeric
then no action is taken on that row. Thoughts??



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Delete row if cell in column "E" has 1 or more alpha character

Good point! I had forgotten about that.

--
Rick (MVP - Excel)


"Tushar Mehta" wrote in
message ...
This is probably OK with the OP but it does delete rows where the corr.
col E
cell contains a string with only numbers. For example, it deletes a row
with
'5 in the corresponding col. E cell.

--
Tushar Mehta
http://www.tushar-mehta.com
Custom business solutions leveraging a multi-disciplinary approach
In Excel 2007 double-click to format may not work; right click and select
from the menu


"Rick Rothstein" wrote:

Assuming you are running this code in the ActiveSheet (so that the Range
is
referenced correctly), then this statement should do what you want...

Range("E5:E" & Rows.Count).SpecialCells(xlCellTypeConstants, _
xlTextValues).EntireRow.Delete

You can put it into a macro or execute it from the Immediate window.

--
Rick (MVP - Excel)


"Peruanos72" wrote in message
...
I'm trying to delete rows of data after row 4 if the cell in column "E"
has
any alpha characters in it at all. If the cell in column "E" is all
numeric
then no action is taken on that row. Thoughts??




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default Delete row if cell in column "E" has 1 or more alpha character

This worked beautifully. Thx!!!

"Per Jessen" wrote:

Try this:

Sub DeleteNonNumericRows()
LastRow = Range("E" & Rows.Count).End(xlUp).Row
For r = LastRow To 4 Step -1
If Not IsNumeric(Cells(r, "E")) Then
Rows(r).Delete
End If
Next
End Sub

Hopes this helps.

---
Per

"Peruanos72" skrev i meddelelsen
...
I'm trying to delete rows of data after row 4 if the cell in column "E"
has
any alpha characters in it at all. If the cell in column "E" is all
numeric
then no action is taken on that row. Thoughts??



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
Delete row if cell in column "E" has 1 or more alpha characters Rick Rothstein Excel Programming 0 April 15th 09 10:09 PM
Delete row if cell in column "E" has 1 or more alpha characters Tushar Mehta[_4_] Excel Programming 0 April 15th 09 09:44 PM
Delete row if cell in column "E" has 1 or more alpha characters Per Jessen Excel Programming 0 April 15th 09 09:42 PM
Find the word "total" in a cell, delete row or column Lawlerd[_3_] Excel Programming 1 October 22nd 04 12:14 AM
Find the word "total" in a cell, delete row or column Lawlerd Excel Programming 1 October 20th 04 12:02 PM


All times are GMT +1. The time now is 02:43 PM.

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

About Us

"It's about Microsoft Excel"