LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Very small macro/VBA stuff, deleting rows.

I have taken the three of your replies in account and this is what
ended up with.


Code
-------------------

Sub DeleteDoubles()
Worksheets("sheet1").Activate
Dim i As Integer, j As Integer
j = ActiveSheet.UsedRange.Rows.Count + ActiveSheet.UsedRange.Row - 1
For i = j To 1 Step -1
If ActiveSheet.Cells(i, 7).Value = ActiveSheet.Cells(i - 1, 7).Value Then
Rows(i).Delete Shift:=xlUp
End If
Next i
End Sub

-------------------


I used the last row expression from Roderick, the backwards structur
from Jarek, but it still wouldn't compile, then I saw Tom's reply an
changed the 1 into a 2 and it worked! I checked your algorithm too to
and it works as well. I could probably do this without the two integer
but i'm not too concerned with efficiency right now ^^ thx a bunch all

--
Message posted from http://www.ExcelForum.com



 
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
Macro for deleting rows and serialising the remaing rows Srinivasulu Bhattaram Links and Linking in Excel 1 November 13th 08 08:44 AM
Macro for deleting rows and serialising the remaing rows Srinivasulu Bhattaram Setting up and Configuration of Excel 1 November 12th 08 06:05 PM
Macro for deleting rows and serialising the remaing rows Srinivasulu Bhattaram Excel Worksheet Functions 1 November 12th 08 01:39 PM
Deleting rows with macro PhilScratchingmyhead Excel Worksheet Functions 2 June 29th 06 05:55 PM
deleting rows macro fullymooned[_5_] Excel Programming 2 June 16th 04 10:27 PM


All times are GMT +1. The time now is 01:54 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"