Hide or delete row contents depending on matching column criterea

J

John Ross

Hi all

I have an external application which populates an excel template with data
to produce the xls file in Excel 2003.

Now I can change the template so I can have different types of data in
different sheets in the workbook but on some cases it would be a benefit to
hide or delete the rows (records) based on the contents of a specified column.

Unfortunately I need to exclude say the first 5 rows as thats where the
column= inserts exist for the template to start populating data.

So say cells on column D5 and below contain the strings ELC, MLCC, MCR and I
only want to keep the rows with MLCC present what would be the best way to do
this? and could anyone provide me with an example?

Thanks in advance for any help

BR, John
 
J

John Ross

OK I have found a few tips around and I can at least define exactly what I
want to do now, sorry if the first post was not clear.

I have a column M with data starting definately at row10 and ending in a
preset row called EndRow.

This column can contain say R,C,F,L,T,U or similar repeating strings.

Now what I need to do is have a macro that will effectively start at row 10,
look up the string in column M and if say the contents of the cell in column
M is not = R then delete entire row.

The reason I need a negative of the matched string is thats the easiest way
to keep what i want and discard the rest.

Sort of

Worksheet=Sheet2 (or could be sheet 1 or 3 or whatever it is named)

start at row 10, end at row (EndRow) where EndRow variable is user defined

If Cell at M (Current row) = Not R then Select and delete row
else go to CurrentRow+1
Keep going until EnRow= set value)
End

Unfortunately my coding skills are REALLY bad and any help to translate this
into a macro would be appreciated.

BR, John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top