PC Review


Reply
Thread Tools Rate Thread

Deeting rows based on entry in a cell

 
 
Gazza
Guest
Posts: n/a
 
      3rd Oct 2006
Hi,

I have a user defined function that places a key word in the last column of
data, making the data easier to sort. There are hundreds of records but in
column F the function places the key word from 3 choices - Processed,
Pending, Finished. How can I set up a macro to delete all the records apart
from "Processed".

OR having allocated the keyword using the function move all the Pending
records to a separate sheet and the Finished records to a third sheet and
then tidy up any gaps.

Thanks

Gaz


 
Reply With Quote
 
 
 
 
Greg Glynn
Guest
Posts: n/a
 
      3rd Oct 2006
Gazza,

When deleting entire rows of data, I find it easier to start from the
bottom and work up.

Sub ZapEm()

LastRow = 1000 ' You should improve this by defining the size of your
range.

For x = LastRow to 1 step -1
if Range("F" & x).Value <> "Processed" then
Range(X & ":" & x).entirerow.delete
End If
End sub


Gazza wrote:
> Hi,
>
> I have a user defined function that places a key word in the last column of
> data, making the data easier to sort. There are hundreds of records but in
> column F the function places the key word from 3 choices - Processed,
> Pending, Finished. How can I set up a macro to delete all the records apart
> from "Processed".
>
> OR having allocated the keyword using the function move all the Pending
> records to a separate sheet and the Finished records to a third sheet and
> then tidy up any gaps.
>
> Thanks
>
> Gaz


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Force entry into cell, based on validation selection in adjacent cell Richhall Microsoft Excel Worksheet Functions 3 18th Jun 2009 10:28 AM
Change Text Color in one cell based upon entry in referenced cell Tee Microsoft Excel Misc 3 12th Sep 2008 10:07 PM
restricting entry into a cell based on entry to a previous cell newbie57 Microsoft Excel New Users 1 9th Jun 2008 05:43 PM
Moving Rows to another sheet based on an entry =?Utf-8?B?TGlrZXRva25vdw==?= Microsoft Excel Worksheet Functions 0 22nd Aug 2006 04:50 AM
Moving Rows to another sheet based on an entry =?Utf-8?B?TGlrZXRva25vdw==?= Microsoft Excel Worksheet Functions 0 22nd Aug 2006 04:50 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:49 AM.