Re: Macro that deletes certain rows and not others

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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" <Rowan@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:00917A4C-A45F-4D87-9A4D-BD7743F734A8@xxxxxxxxxxxxxxxx
> 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).EntireRow.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" <rb10@xxxxxxxxxx> wrote in message
>> news:OGoEL5qTFHA.3244@xxxxxxxxxxxxxxxxxxxxxxx
>> >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
>> >
>>
>>
>>


.



Relevant Pages