A huge job for the experienced

A

a94andwi

Hello.

In my daily work as a material controller I everyday check an error
list that a system provides for me. This error list generates all part
numbers that will be out of stock in 5 days. This to make me order new
parts.

Today I manually copy the values from the error list into an excel
file.
This file contains these columns,

Supplier, Partnumber, Which date the part is out of stock, How many we
are short on (Depending on the order stock), Which date we have the
next planned shipment, How many, Transit time, Which day the part
actually are out of stock(For special parts), A simple note field

Because of the fact that I every day see five days ahead I see the same
rows for five days although I already the first day have written
delivery info in the note field.

I would like to have a loop that checks the first row and puts
"Supplier, Partnumber, Which date the part is out of stock, How many we
are short on (Depending on the order stock), Which date we have the next
planned shipment, How many" in a array and then loops through all rows
and looks after a completely simmilar row and then clears it. After the
loop has finnished for the first rows partnumber then the loop should
continue with row two and so on.

Is this understandable?

Are someone able to give me a complete sollution for this or some hints
about how to make it work than I'll be glad.

Thanks in advance.

/Anders
 
G

Guest

We are not sure how you see the five rows.
If you manually copy them every day, we assume the daily entries are grouped
in blocks in descending order.
If you can sort them to line up the 8 fields with the note field as the
first row
then try this.

You have to complete the AND statement to capture all the 6 field you
mentioned if they are important please.

Sub t()
lastrow = Range("A" & Rows.Count).End(xlUp).Row
For i = lastrow To 1 Step -1
If Range("A" & i) = Range("A" & i - 1) And Range("B" & i) = Range("B" & i -
1) Then
Row(i).Delete
End If
Next i
End Sub
 
A

a94andwi

Hello.

Thanks for your input. Will in be any easier if I could attach an
example?
I have attached an example.

The fields that comes from the system are the first four columns. Every
day I open the excelfile from yesterday and add todays new rows. This is
when I want to delete those rows that were there yesterday as well. If I
am able to do that with a simple macro I do not need to write the same
info as yesterday in the notefield. I will only keep the new rows from
todays list.

Thanks
Anders


+-------------------------------------------------------------------+
|Filename: Errorfile.txt |
|Download: http://www.excelforum.com/attachment.php?postid=4424 |
+-------------------------------------------------------------------+
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top