Delete data for 20000 rows when contains words in two columns

Abdo

Board Regular
Joined
May 16, 2022
Messages
245
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
Hello ,
I have about 20000 rows divided multiple ranges . what I want to exclude lastrow contains TOTAL word in column A and exclude row contains FIRST DURETION word in column D for second row , sometimes not all ranges contain FIRST DURETION word .
after that should merge duplicated amounts in column E,F based on column D and sum whole columns D,E and show total as showing in column A,B to the bottom .every time add new ID in column D so will increase ID to show total in column A,B to the bottom.

copy to bottom based on cell.xlsm
ABCDEFG
1DATEINVOICE NOCLIENT NODESCRIBEDEBITCREDITBALANCE
201/01/2024-ABDEND1FIRST DURETION20,000.0020,000.00
302/01/2024PA-B3ABDEND1PA20,000.0040,000.00
403/01/2024SA-B35ABDEND1SA1,000.0039,000.00
5TOTAL40,000.001,000.0039,000.00
6
7
8DATEINVOICE NOCLIENT NODESCRIBEDEBITCREDITBALANCE
914/01/2024PA-B352ABDEND10PA140.00140.00
1015/01/2024PA-B352ABDEND10PA100.000.00
11TOTAL240.00240.000.00
12
13
14DATEINVOICE NOCLIENT NODESCRIBEDEBITCREDITBALANCE
1514/04/2024PA-B442ABDEND100FIRST DURETION1,040.001,040.00
1615/04/2024PA-B442ABDEND100SA1,000.0040.00
1716/04/2024PA-B442ABDEND100PA2,000.002,040.00
18TOTAL3,040.001,000.002,040.00
19
20
21DATEINVOICE NOCLIENT NODESCRIBEDEBITCREDITBALANCE
2230/09/2024PA-B1342ABDEND1000FIRST DURETION10,040.0010,040.00
2301/10/2024PA-B1342ABDEND1000SA40.0010,000.00
2402/10/2024PA-B1342ABDEND1000SA8,000.002,000.00
2503/10/2024PA-B1342ABDEND1000PA500.002,500.00
26TOTAL10,540.008,040.002,500.00
splitting




before running macro
copy to bottom based on cell.xlsm
ABCDEFGHI
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
RESULT1



after running
copy to bottom based on cell.xlsm
ABCDEF
1ITEMINVOICE NOCLIENT NODESCRIBEDEBITCREDIT
21PA-B3ABDEND1PA20,000.00
32SA-B35ABDEND1SA1,000.00
43PA-B352ABDEND10PA240.00
54PA-B442ABDEND100SA1,000.00
65PA-B442ABDEND100PA2,000.00
76PA-B1342ABDEND1000SA8,040.00
87PA-B1342ABDEND1000PA500.00
9
10PA TOTAL22,740.00
11SA TOTAL1,040.00
RESULT1


thanks
 
1)
Rich (BB code):
        With .Rows(i + 2).Range("d1").Resize(dic.Count, 2)
2
Rich (BB code):
        With Union(.Rows(1), .Rows(i + 2).Range("d1").Resize(dic.Count, 1))
 
Upvote 0

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

Forum statistics

Threads
1,226,112
Messages
6,189,040
Members
453,521
Latest member
Chris_Hed

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