Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Applications / Excel / September 2007



Tip: Looking for answers? Try searching our database.

Hide or delete row contents depending on matching column criterea

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John Ross - 29 Sep 2007 22:56 GMT
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
John Ross - 29 Sep 2007 23:59 GMT
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
JE McGimpsey - 30 Sep 2007 14:28 GMT
> The reason I need a negative of the matched string is thats the easiest way
> to keep what i want and discard the rest.

An easier way might be to do an advanced filter to a new worksheet:

   http://www.contextures.com/xladvfilter01.html
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.