I am trying to write a macro to check each cell in the A column. If the cells below it are the same then take the data from column b and update either column C or D depending on the data. Once all the data has been updated in those columns it deletes the rows below the first row with the data in it. The B column would then be deleted. I have tried writing it myself but have never wrote macros in excel. Any help would be appreciated.

Thanks!

Before:

A B C D
h1 c 0 0
h1 d 0 0
h1 c 0 0
h2 c 0 0
h2 c 0 0

After:

A B C D
h1 2 1
h2 2 0