MACRO: seek, copy and paste only the last review of a drawing

Dampyr2345

New Member
Joined
Jan 23, 2018
Messages
1
Hi everybody!

I work in a technical office for a construction firm. As you can imagine, we have an Excel file with thousands detailed drawings regarding the construction. Every drawing is associated to a code, which is made up of various parts. I avoid to explane each part of the code, the only important parts for the Macro that has to be created are the bold ones in the following code (e.g. a drawing in the attached file):

02 H61 KT 011 KSC B0130 214A2 00

- 214A2 is a part that is UNIVOCAL for each drawing;
- 00 is the review of the drawing: each of them started with 00, but later other reviews could have been added, such as 01, 02, 03 and so on.

The whole system is actually designed to keep track of every single drawing, including every single review. In the annexed table (specifically in "Drawing List") you can see what I mean: of course it is just a part of the whole file, it is just to explane the concept.

Now, coming to the point... someone told me "ok, it's great, but many employers only need THE LAST REVIEW of the drawing, could you do something?". Well, in order to solve this problem, I was thinking about creating a new sheet, linked to the previous one, and using a macro to select, copy and paste the rows containing ONLY THE LAST REVIEW of each drawing. In other words, I need something to do this job:
- with reference to "Drawing List", identify all the drawings with the same univocal part (e.g. 214A2);
- among them, take the one that shows the most advanced review (e.g. 04), copy and paste in the other sheet ("Desired Result") the whole row which contains that review.

It has to be a repeatable macro, in the sense that I will use it every time I update the general sheet, for example adding a new drawing or simply a new review. I don't care so much about the order in which rows will be copied and pasted: one possible desired result is shown in "Desired Result", in which rows are consecutive; in alternative, keeping the position of the original row might be good as well (for example, row number 7 pasted in row number 7 in the new sheet).

Do you think it is possible? Considering that I have never built a macro, for me it's extremely hard... HELP ME, PLEASE

I would like to thank everyone who will try to solve this problem.

Bye!

DRAWING LIST:

[TABLE="width: 1445"]
<tbody>[TR]
[TD][TABLE="width: 500"]
<tbody>[TR]
[TD][TABLE="width: 192"]
<tbody>[TR]
[TD]12 - ELABORATI GENERALI[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 60"]
<tbody>[TR]
[TD]17A[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 134"]
<tbody>[TR]
[TD]Variante SUD[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 201"]
<tbody>[TR]
[TD]Programma lavori - GANTT[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 47"]
<tbody>[TR]
[TD]02[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 47"]
<tbody>[TR]
[TD]H61[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 47"]
<tbody>[TR]
[TD]EG[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 61"]
<tbody>[TR]
[TD]991[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 61"]
<tbody>[TR]
[TD]KBA[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 57"]
<tbody>[TR]
[TD]B0130[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 61"]
<tbody>[TR]
[TD]V1XE6[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 88"]
<tbody>[TR]
[TD]00[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 307"]
<tbody>[TR]
[TD]TRASMESSO - IN ATTESA DI ISTRUTTORIA[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]00[/TD]
[/TR]
[TR]
[TD][TABLE="width: 192"]
<tbody>[TR]
[TD]20 - PARTE I[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 60"]
<tbody>[TR]
[TD]29[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 134"]
<tbody>[TR]
[TD]CE in tradizionale[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 201"]
<tbody>[TR]
[TD]Geometria e vista d'insieme[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 47"]
<tbody>[TR]
[TD]02[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 47"]
<tbody>[TR]
[TD]H61[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 47"]
<tbody>[TR]
[TD]EG[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 61"]
<tbody>[TR]
[TD]011[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 61"]
<tbody>[TR]
[TD]KSC[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 57"]
<tbody>[TR]
[TD]B0130[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 61"]
<tbody>[TR]
[TD][TABLE="width: 61"]
<tbody>[TR]
[TD]214A2[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 88"]
<tbody>[TR]
[TD]00[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 307"]
<tbody>[TR]
[TD]APPROVATO CON PRESCRIZIONI[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]00[/TD]
[/TR]
[TR]
[TD][TABLE="width: 192"]
<tbody>[TR]
[TD]20 - PARTE I[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 60"]
<tbody>[TR]
[TD]29[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 134"]
<tbody>[TR]
[TD]CE in tradizionale[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 201"]
<tbody>[TR]
[TD]Geometria e vista d'insieme[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 47"]
<tbody>[TR]
[TD]02[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 47"]
<tbody>[TR]
[TD]H61[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 47"]
<tbody>[TR]
[TD]EG[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 61"]
<tbody>[TR]
[TD]011[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 61"]
<tbody>[TR]
[TD]KSC[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 57"]
<tbody>[TR]
[TD]B0130[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 61"]
<tbody>[TR]
[TD][TABLE="width: 61"]
<tbody>[TR]
[TD]214A2[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 88"]
<tbody>[TR]
[TD]01[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 307"]
<tbody>[TR]
[TD]APPROVATO[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]01[/TD]
[/TR]
[TR]
[TD][TABLE="width: 192"]
<tbody>[TR]
[TD]20 - PARTE I[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 60"]
<tbody>[TR]
[TD]29[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 134"]
<tbody>[TR]
[TD]CE in tradizionale[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 201"]
<tbody>[TR]
[TD]Geometria e vista d'insieme[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 47"]
<tbody>[TR]
[TD]02[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 47"]
<tbody>[TR]
[TD]H61[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 47"]
<tbody>[TR]
[TD]EG[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 61"]
<tbody>[TR]
[TD]011[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 61"]
<tbody>[TR]
[TD]KSC[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 57"]
<tbody>[TR]
[TD]B0130[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 61"]
<tbody>[TR]
[TD][TABLE="width: 61"]
<tbody>[TR]
[TD]214A2[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 88"]
<tbody>[TR]
[TD]02[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 307"]
<tbody>[TR]
[TD]TRASMESSO - IN ATTESA DI ISTRUTTORIA[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]02[/TD]
[/TR]
[TR]
[TD][TABLE="width: 192"]
<tbody>[TR]
[TD]20 - PARTE I[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 60"]
<tbody>[TR]
[TD]29[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 134"]
<tbody>[TR]
[TD]CE in tradizionale[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 201"]
<tbody>[TR]
[TD]Geometria e vista d'insieme[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 47"]
<tbody>[TR]
[TD]02[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 47"]
<tbody>[TR]
[TD]H61[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 47"]
<tbody>[TR]
[TD]EG[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 61"]
<tbody>[TR]
[TD]011[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 61"]
<tbody>[TR]
[TD]KSC[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 57"]
<tbody>[TR]
[TD]B0130[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 61"]
<tbody>[TR]
[TD][TABLE="width: 61"]
<tbody>[TR]
[TD]214A2[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 88"]
<tbody>[TR]
[TD]03[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 307"]
<tbody>[TR]
[TD]APPROVATO CON PRESCRIZIONI[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]03[/TD]
[/TR]
[TR]
[TD][TABLE="width: 192"]
<tbody>[TR]
[TD]20 - PARTE I[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 60"]
<tbody>[TR]
[TD]29[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 134"]
<tbody>[TR]
[TD]CE in tradizionale[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 201"]
<tbody>[TR]
[TD]Geometria e vista d'insieme[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 47"]
<tbody>[TR]
[TD]02[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 47"]
<tbody>[TR]
[TD]H61[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 47"]
<tbody>[TR]
[TD]EG[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 61"]
<tbody>[TR]
[TD]011[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 61"]
<tbody>[TR]
[TD]KSC[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 57"]
<tbody>[TR]
[TD]B0130[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 61"]
<tbody>[TR]
[TD][TABLE="width: 61"]
<tbody>[TR]
[TD]214A2[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 88"]
<tbody>[TR]
[TD]04[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 307"]
<tbody>[TR]
[TD]TRASMESSO - IN ATTESA DI ISTRUTTORIA[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]04[/TD]
[/TR]
[TR]
[TD][TABLE="width: 192"]
<tbody>[TR]
[TD]20 - PARTE I[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 60"]
<tbody>[TR]
[TD]29[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 134"]
<tbody>[TR]
[TD]CE in tradizionale[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 201"]
<tbody>[TR]
[TD]Carpenteria sella[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 47"]
<tbody>[TR]
[TD]02[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 47"]
<tbody>[TR]
[TD]H61[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 47"]
<tbody>[TR]
[TD]EG[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 61"]
<tbody>[TR]
[TD]011[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 61"]
<tbody>[TR]
[TD]KSC[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 57"]
<tbody>[TR]
[TD]B0130[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 61"]
<tbody>[TR]
[TD][TABLE="width: 61"]
<tbody>[TR]
[TD][TABLE="width: 61"]
<tbody>[TR]
[TD]214A3[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 88"]
<tbody>[TR]
[TD]00[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 307"]
<tbody>[TR]
[TD]TRASMESSO - IN ATTESA DI ISTRUTTORIA[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]00[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
DESIRED RESULT:
[TABLE="width: 500"]
<tbody>[TR]
[TD][TABLE="width: 192"]
<tbody>[TR]
[TD]12 - ELABORATI GENERALI[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 60"]
<tbody>[TR]
[TD]17A[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 134"]
<tbody>[TR]
[TD]Variante SUD[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 201"]
<tbody>[TR]
[TD]Programma lavori - GANTT[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 47"]
<tbody>[TR]
[TD]02[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 47"]
<tbody>[TR]
[TD]H61[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 47"]
<tbody>[TR]
[TD]EG[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 61"]
<tbody>[TR]
[TD]991[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 61"]
<tbody>[TR]
[TD]KBA[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 57"]
<tbody>[TR]
[TD]B0130[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 61"]
<tbody>[TR]
[TD]V1XE6[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 88"]
<tbody>[TR]
[TD]00[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 307"]
<tbody>[TR]
[TD]TRASMESSO - IN ATTESA DI ISTRUTTORIA[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]00[/TD]
[/TR]
[TR]
[TD][TABLE="width: 192"]
<tbody>[TR]
[TD]20 - PARTE I[/TD]
[/TR]
[TR]
[TD]20 - PARTE I[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 60"]
<tbody>[TR]
[TD]29[/TD]
[/TR]
[TR]
[TD]29[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 134"]
<tbody>[TR]
[TD]CE in tradizionale[/TD]
[/TR]
[TR]
[TD]CE in tradizionale[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 201"]
<tbody>[TR]
[TD]Geometria e vista d'insieme[/TD]
[/TR]
[TR]
[TD]Carpenteria sella[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 47"]
<tbody>[TR]
[TD]02[/TD]
[/TR]
[TR]
[TD]02[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 47"]
<tbody>[TR]
[TD]H61[/TD]
[/TR]
[TR]
[TD]H61[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 47"]
<tbody>[TR]
[TD]EG[/TD]
[/TR]
[TR]
[TD]EG[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 61"]
<tbody>[TR]
[TD]011[/TD]
[/TR]
[TR]
[TD]011[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 61"]
<tbody>[TR]
[TD]KSC[/TD]
[/TR]
[TR]
[TD]KSC[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 57"]
<tbody>[TR]
[TD]B0130[/TD]
[/TR]
[TR]
[TD]B0130[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 61"]
<tbody>[TR]
[TD][TABLE="width: 61"]
<tbody>[TR]
[TD]214A2[/TD]
[/TR]
[TR]
[TD]214A3[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 88"]
<tbody>[TR]
[TD]04[/TD]
[/TR]
[TR]
[TD]00[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 307"]
<tbody>[TR]
[TD]APPROVATO CON PRESCRIZIONI[/TD]
[/TR]
[TR]
[TD]TRASMESSO - IN ATTESA DI ISTRUTTORIA[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]04[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Hi & welcome to the board.
How about
Code:
Sub GetLatest()

   Dim Cl As Range
   Dim Itm As Variant
   
   With CreateObject("scripting.dictionary")
      For Each Cl In Range("K2", Range("K" & Rows.Count).End(xlUp))
         If Not .exists(Cl.Value) Then
            .Add Cl.Value, Array(Cl.Offset(, 1).Value, Cl)
         ElseIf Cl.Offset(, 1).Value > .Item(Cl.Value)(0) Then
               .Item(Cl.Value) = Array(Cl.Offset(, 1), Cl)
         End If
      Next Cl
      For Each Itm In .items
         Itm(1).EntireRow.Copy Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Offset(1)
      Next Itm
   End With
            
End Sub
This assumes that the data is in the active sheet, with a header in row 1 & data starting in row 2. Also that your drawing numbers are in col K with the issue in L
 
Upvote 0

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top