View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Roger[_20_] Roger[_20_] is offline
external usenet poster
 
Posts: 15
Default Macro that deletes certain rows and not others

Rowan, thanks for the update and sorry for any confusion. Your new macro
works very well with one exception - hopefully minor.
I would like the data to start at D16 as there is info above there that I
would like to keep there if possible.

BTW I am using Excel 2002 and would like it to work in Excel 5 as well if
that is possible.

Thanks,

Roger


"Rowan" wrote in message
...
Roger

I am afraid you new explanation has left me more confused than before but
that could just be me :)

If you just want to delete any row which has a blank or numeric data in
column D then you can adapt Tom's answer as follows:

Sub DelRows()
On Error Resume Next
Columns(4).SpecialCells(xlConstants, xlNumbers).EntireRow.Delete
Columns(4).SpecialCells(xlCellTypeBlanks).EntireRo w.Delete
End Sub

If there is something else you want to achieve then you will probably need
to explain what is in rows 1 - 14 and what you want done with these rows,
what data is in columns E and C and what their relationship is to column D
and what you mean by "before corrections are done".

Hope this helps
Rowan

"Roger" wrote:


First of all let me thank each of you Rowan, Tom and Vasant for trying to
solve my problem. Unfortunately because I am a relatively basic macro
user
I could not get any of the 3 macros to work although I did spend several
hours trying.

However I have learned a lot so here are my ideas that may help you solve
the problem if you would be so kind. My data starts on row 14 and is
spread
out down to row 50 before any corrections are done. They do end up as 15
as
previously mentioned. The column to search is D where there are only
cells
that are either blank, numeric or text. Column E has my data in it and
does
not need any work that won't be solved by the correct info in column C.

I look forward to your answers and thank you again for all your help.

Roger


"Roger" wrote in message
...
I would like to test the following which are in about 15 rows

if cell contains any kind of text then go to next row as don't want to
delete rows
with text in them
exit if
else - this covers blanks cells and cells with numbers in them
delete row

Repeat until done about 15 times

Any suggestions would be greatly appreciated.

Roger