Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro for deleting rows and serialising the remaing rows | Links and Linking in Excel | |||
Macro for deleting rows and serialising the remaing rows | Setting up and Configuration of Excel | |||
Macro for deleting rows and serialising the remaing rows | Excel Worksheet Functions | |||
Deleting rows with macro | Excel Worksheet Functions | |||
deleting rows macro | Excel Programming |