Delete 100000 rows based on matching the value for first row with last row

Maklil

Board Regular
Joined
Jun 23, 2022
Messages
174
Office Version
  1. 2019
Platform
  1. Windows
Hello
I have multiple ranges in Details sheet if the second row (under header for each range contains value is the same value where is in lastrow(TOTAL) in column E or the lastrow(TOTAL) contains zero in column E then should delete the ranges , otherwise should keep the rest
I have about 100000 rows and increasable .

Merging ranges_3.xlsb
ABCDE
1DATECUSTOMERINV NOITEMQTY
211/11/2000CSS-100INV-A123ITTT-100/AS-1200
31/7/2023CSS-100INV-A123ITTT-100/AS-1100
41/7/2023CSS-100INV-A123ITTT-100/AS-140
51/7/2023CSS-100INV-A123ITTT-100/AS-150
6TOTAL190
7
8
9DATECUSTOMERINV NOITEMQTY
1011/12/2000CSS-100INV-A123ITTT-100/AS-2300
111/7/2023CSS-100INV-A123ITTT-100/AS-2400
12TOTAL400
13
14
15DATECUSTOMERINV NOITEMQTY
1611/15/2000CSS-100INV-A124ITTT-100/AS-2600
171/7/2023CSS-100INV-A124ITTT-100/AS-2300
181/7/2023CSS-100INV-A124ITTT-100/AS-2100
191/7/2023CSS-100INV-A124ITTT-100/AS-2200
20TOTAL600
21
22
23DATECUSTOMERINV NOITEMQTY
2411/17/2000CSS-100INV-A129ITTT-100/AS-7800
251/7/2023CSS-100INV-A129ITTT-100/AS-7500
261/7/2023CSS-100INV-A129ITTT-100/AS-7200
271/7/2023CSS-100INV-A129ITTT-100/AS-7100
28TOTAL0
DETAILS

should be
Merging ranges_3.xlsb
ABCDE
1DATECUSTOMERINV NOITEMQTY
211/11/2000CSS-100INV-A123ITTT-100/AS-1200
31/7/2023CSS-100INV-A123ITTT-100/AS-1100
41/7/2023CSS-100INV-A123ITTT-100/AS-140
51/7/2023CSS-100INV-A123ITTT-100/AS-150
6TOTAL190
7
8
9DATECUSTOMERINV NOITEMQTY
1011/12/2000CSS-100INV-A123ITTT-100/AS-2300
111/7/2023CSS-100INV-A123ITTT-100/AS-2400
12TOTAL400
OUTPUT



thanks
 
You're welcome. Glad we got there in the end. :)
(I have edited the marked solution to include that extra line to auto-fit the columns so the whole solution is together in one post)
 
Upvote 0

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

Forum statistics

Threads
1,223,893
Messages
6,175,244
Members
452,622
Latest member
Laura_PinksBTHFT

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