VBA Macro to check for each ID if criteria exists and delete rows or update value for that ID based on that criteria


I need a Macro to check if for each "ID" under column E, (Type) "Services" under column B exists.

If it does exist, then any other row where Type <> "Services" for that same ID should be deleted.

If type "Services" does not exist for that ID, then all rows for that ID should be deleted except one and value under Column C (Value) for that ID should be replaced by the value in column D (Amount is always the same for the same ID so replace cell C value by any cell value under column D for that ID).

Please refer to sheet1 in the attached file. I have added what is the expect output under sheet "Correct Output1"

The second module or Sub should compare sheet1 to sheet2. (after sheet 1 is modified as above).

So Macro will compare the Sum of values for each ID in sheet1 (after above modification) and compare if it is equal to the sum of values in sheet2 for that same ID. Also will compare the Level for that ID in sheet1 if it is equal to the level in sheet2 (level is always the same for each ID).

If comparing results is the same then do nothing. if there is a discrepancy, then need to copy the rows for that ID from sheet1 and paste them into a new sheet highlighting in red the discrepancy. If ID in sheet1 does not exist in sheet2 then copy all rows for that ID and highlight all rows in red.

Attached in the file sheet "Correct Ouput2" illustrates what the output should be for the second module/sub.

I would really appreciate your help with that.


Umiejętności: Excel, Visual Basic, Visual Basic for Apps

Zobacz więcej: vba macro check data quality, excel macro delete rows word match, delete rows excel macro, macro delete rows vertically merged word, vba macro excel update inventory pricing, delete data clipboard vba macro, vba update value document property, vba macro update, vba macro generate report excel word, excel macro check references, vba 2007 check number dash, vba macro trial, next empty cell vba macro paste, excel vba macro paste adjacent column, vba macro excel unicode

O pracodawcy:
( 0 ocen ) Czech Republic

Numer ID Projektu: #17221911

Przyznany użytkownikowi:

€14 EUR w 1 dzień
(25 ocen)

Hi, Nice to know your requirement. I am an excel vba, vb6 expert and have delivered fourteen excel vba projects in the past seventy days. Willing to take up your project. Thank you, Regards.

€23 EUR w 1 dzień
(33 ocen)

7 freelancerów złożyło ofertę na kwotę €26 do tego projektu


Pm me for the sample on your requirements. Hi Mr. Employer, Glad to contact with you. I can do this project through effective manner with 100% accuracy fulfilled your requirements. I assured that i have provide you 24 Więcej

€30 EUR w ciągu 1 dnia
(65 Oceny)

I can do this. please review my profile and inbox me. I have good command over MS Excel especially povit table, chart, advance formulas, formatting, macros, etc. thanks

€39 EUR w ciągu 1 dnia
(12 Oceny)

Hello there, I would like to be considered for this job as I have great working experience in VBA development. Thanks, Ramesh

€40 EUR w ciągu 2 dni
(5 Oceny)

I have a Diploma in Ms-Office and I am with Expert knowledge on working with Excel and have a good knowledge about the commands. I can give you your requirement within no time.

€23 EUR w ciągu 1 dnia
(0 Oceny)
€14 EUR w ciągu 1 dnia
(0 Oceny)