Deleting multiple rows based on criteria f

KNM5800

New Member
Joined
Sep 7, 2018
Messages
5
I need to identify and remove all accounts that have GGGG as their code. Some accounts have multiple lines and the master report is over 5,000 rows. I have performed conditional formatting to find all the GGGG (this was the easy part). I want to delete all rows for the acct that has GGGG. How can I highlight all rows for the GGGG accounts?
ex: Act 111 has GGGG with a total of 3 rows, all 3 rows need to be removed. How can I quickly find and highlight all rows for an account that has GGGG?
Acct NoOrder DateLastFirstCode
111​
1/23/2020​
AAAZZZGGGG
111​
1/23/2020​
AAAZZZ01111
111​
1/23/2020​
AAAZZZ01111
222​
1/6/2020​
BBBYYYGGGG
222​
1/6/2020​
BBBYYY00999
222​
1/6/2020​
BBBYYY00999
333​
1/31/2020​
CCCXXXGGGG
333​
1/31/2020​
CCCXXX01112
333​
1/31/2020​
CCCXXX01112
444​
1/17/2020​
DDDWWWGGGG
444​
1/17/2020​
DDDWWW09998
444​
1/17/2020​
DDDWWW09998
555​
1/9/2020​
EEEVVV09997
555​
1/9/2020​
EEEVVV09997
666​
1/24/2020​
FFFVVVGGGG
666​
1/24/2020​
FFFUUUGGGG
666​
1/24/2020​
FFFUUU01113
666​
1/24/2020​
FFFUUU01113
777​
1/28/2020​
GGGTTT01111
777​
1/28/2020​
GGGTTT01111
888​
1/13/2020​
HHHSSS00999
888​
1/13/2020​
HHHSSS00999
999​
1/2/2020​
IIIRRRGGGG
999​
1/2/2020​
IIIRRR09996
999​
1/2/2020​
IIIRRR09996
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
You could put a formula in the next column, then filter that for True & delete those rows
+Fluff New.xlsm
ABCDEF
1Acct NoOrder DateLastFirstCodeDelete
21111/23/2020AAAZZZGGGGTRUE
31111/23/2020AAAZZZ1111TRUE
41111/23/2020AAAZZZ1111TRUE
52221/6/2020BBBYYYGGGGTRUE
62221/6/2020BBBYYY999TRUE
72221/6/2020BBBYYY999TRUE
83331/31/2020CCCXXXGGGGTRUE
93331/31/2020CCCXXX1112TRUE
103331/31/2020CCCXXX1112TRUE
114441/17/2020DDDWWWGGGGTRUE
124441/17/2020DDDWWW9998TRUE
134441/17/2020DDDWWW9998TRUE
145551/9/2020EEEVVV9997FALSE
155551/9/2020EEEVVV9997FALSE
166661/24/2020FFFVVVGGGGTRUE
176661/24/2020FFFUUUGGGGTRUE
186661/24/2020FFFUUU1113TRUE
196661/24/2020FFFUUU1113TRUE
207771/28/2020GGGTTT1111FALSE
217771/28/2020GGGTTT1111FALSE
228881/13/2020HHHSSS999FALSE
238881/13/2020HHHSSS999FALSE
249991/2/2020IIIRRRGGGGTRUE
259991/2/2020IIIRRR9996TRUE
269991/2/2020IIIRRR9996TRUE
Result
Cell Formulas
RangeFormula
F2:F26F2=COUNTIFS(A:A,A2,E:E,"GGGG")>0
 
Upvote 0
I tried plugging the formula you provided into the next adjacent cell. I am getting an error: =COUNTIFS(A:A,A2,E:E,"GGGG")>0

I know the basics of excel and can do some formatting and macros, but this has just got me. I'm sure it is a lot easier than I am making it. I want to make sure I understand your formula. A:A - is all column A, A2 - start looking here, E:E - all column E, "GGGG" - this is the "rule", >0 - greater than zero.
So, where column E = GGGG, define (TRUE) the matching rows in column A starting with A2?
 
Upvote 0
You may need to change the commas to semicolons, if that's what you normally use in your formulae.
 
Upvote 0
I changed to semi colons and still with one error, (A:A;A2;E:E;"GGGG")>0
I appreciate your help.
 
Upvote 0
Try copying the minisheet from post#2 into a blank sheet in your workbook.
To copy it use the copy icon
1588259704787.png
 
Upvote 0

Forum statistics

Threads
1,214,904
Messages
6,122,169
Members
449,070
Latest member
webster33

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