G
Guest
Here is a quick version of the situation. I have a file with 7 columns of data and I sort it with a script. Then I have another script that goes through and deletes files based on a certain paramenter. If the value in "A1" = "A2" and "D1" = "D2" then delete the row "2" as long as the value in "C2" is less than the value in "C1" - then contine on throught the entire range deleting rows
So far the sort works and I think I am close on the loop - using two books and info found in here - but I am not sure whats wrong and why it isn't working right. Here's the code I have so far
Option Explici
Public i As Range, Startingi As Rang
Public Brand As String, Type As String, Quantity As Intege
Sub DeletePairs(
Dim SortRange As Rang
Set SortRange = Range("A1", Range("A" & Rows.Count).End(xlUp).Offset(0, 7).
Address
Set Startingi =
Type = i.Valu
Brand = i.Offset(0, 1).Valu
Do While Not (i.Offset(0, 0) = i.Offset(1, 0) & i.Offset(0, 1) = i.Offset(1, 1)
If i.Offset(0, 2) > i.Offset(1, 2) The
i.Offset(1).EntireRow.Delet
End I
Loo
End Su
I am new to this type of scripting, I really only know the basics - so I am not sure if I am even on the right path - It only what I have sort of pieced together so far
Any help would be greatly appreciated, because the frustration level is starting to get hig
Mike Etzkor
So far the sort works and I think I am close on the loop - using two books and info found in here - but I am not sure whats wrong and why it isn't working right. Here's the code I have so far
Option Explici
Public i As Range, Startingi As Rang
Public Brand As String, Type As String, Quantity As Intege
Sub DeletePairs(
Dim SortRange As Rang
Set SortRange = Range("A1", Range("A" & Rows.Count).End(xlUp).Offset(0, 7).
Address
Set Startingi =
Type = i.Valu
Brand = i.Offset(0, 1).Valu
Do While Not (i.Offset(0, 0) = i.Offset(1, 0) & i.Offset(0, 1) = i.Offset(1, 1)
If i.Offset(0, 2) > i.Offset(1, 2) The
i.Offset(1).EntireRow.Delet
End I
Loo
End Su
I am new to this type of scripting, I really only know the basics - so I am not sure if I am even on the right path - It only what I have sort of pieced together so far
Any help would be greatly appreciated, because the frustration level is starting to get hig
Mike Etzkor