Wrox Programmer Forums
|
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 15th, 2003, 04:12 AM
Registered User
 
Join Date: Oct 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Delete rows with macro?

Hello Guys!

I have a worksheet containg 2 colums and couple of hundred
rows. For examle:

8:45 384
9:30 384
12:40 384
17:05 384
7:35 566
10:30 566
11:39 566
16:05 566
17.10 566

How can I leave only first and the last timestamp for number
384 and 566 and delete all the other rows. How could I do
this with macro?

The result should be:
8:45 384
17:05 384
7:35 566
17.10 566

Please help me,
Jessica



 
Old October 15th, 2003, 05:12 AM
Registered User
 
Join Date: Oct 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have already got a solution

   Do Until ActiveCell.Value = ""
      If ActiveCell.Offset(1, 0).Value = ActiveCell.Value And ActiveCell.Offset(2, 0).Value = ActiveCell.Value Then
         ActiveCell.Offset(1, 0).EntireRow.Delete
      Else
         ActiveCell.Offset(1, 0).Activate
      End If
   Loop

Jessica






Similar Threads
Thread Thread Starter Forum Replies Last Post
How can you delete duplicate rows without using te subhasischakraborty SQL Server 2000 15 October 19th, 2007 06:51 AM
Speed up macro - deleting rows icabo Excel VBA 1 October 8th, 2007 02:18 PM
How to delete unique rows but with duplicate colum winder SQL Server 2005 3 January 3rd, 2007 04:57 PM
delete duplicates rows guga121 MySQL 2 June 20th, 2006 12:24 AM
delete rows miguel.ossa C# 1 August 26th, 2004 12:58 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.