Prev Previous Post   Next Post Next
  #1   Report Post  
zack
 
Posts: n/a
Default Delete row 'if'

I would grateful for any assistance, as fairly new to VBA and producing
macros.

On a regular basis I have lists of contacts where I have to manually
delete rows that meet certain criteria. This is a time comsuming
process, that I need to automate.

Each row of data includes fields, eg title,first
name,surname,address,active address,etc.
The data is presorted by 'surname' and then 'firstname'.
One person may appear any number of times.
The 'active address' column is populated with either a 'y' or 'n'.
I need a way to delete any row where an 'n' appears in the
'active_address' column, BUT only if the same person appears on the
line above with a 'y'.
Hope this make sense. Please see example below.
DATE PERSON CODE TITLE FIRST SURNAME ACTIVE ADDRESS
05-Aug-05 193079 MISS Jane Doe Y 12 Smith Street SALFORD M7 4EF
03-Aug-05 193079 MISS Jane Doe Y 12 Smith Street SALFORD M7 4EF
03-Aug-05 193079 MISS Jane Doe N 474 Berry New Road SALFORD M7 4NU
05-Aug-05 193079 MISS Jane Doe N 474 Berry New Road SALFORD M7 4NU
The bottom 2 rows are ones that require deletion.
Kind regards Zack

 
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
In a protected worksheet allow users to delete rows Jason Trivett Excel Worksheet Functions 1 July 12th 05 09:50 AM
Delete row depending on criteria adw223 Excel Discussion (Misc queries) 1 June 30th 05 12:55 AM
How to delete rows when List toolbar's "delete" isnt highlighted? Linda Excel Worksheet Functions 1 May 26th 05 08:39 PM
How to delete blank rows John Mansfield Excel Discussion (Misc queries) 3 April 27th 05 11:48 PM
Macro to delete data in 'green' cells only Steve Excel Worksheet Functions 7 March 19th 05 01:40 PM


All times are GMT +1. The time now is 11:28 PM.

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

About Us

"It's about Microsoft Excel"