Create a Macro/ VBA Edit To delete the row if a cell in a particular column contains the same as the cell above

  • Hello community!
    New member and reasonably new to excel, would love some help
    Please see the image attached as this will make a lot more sense.

    i.e. I need a Macro or piece of code that will delete a row if a cell in column B contains the same number as the cell above
    Basically I have a column of numbers (Column B) from 1-476 (I have included a small snippet of this column. Due to a number of duplicate numbers in this column, the column is actually 596 numbers long. Some numbers have dates next to them as you can see in the image. Where there is a duplicate number in column B, I have been manually deleting the row containing the duplicate with no date as you can see for Row 277 (number 241), Row 279 (number 243) etc etc. Of the numbers were there are duplicates i.e. Row 288 and 289, I want the row with a corresponding date to remain and want to get rid of the duplicate's entire row so that my Column B goes from 1-476 ascending in perfect chronological order with no duplicates. Does this make sense?
    i.e. I need a Macro that will delete a row if the cell contains the same number as the cell above BUT only for column B
    Thanks in advance! Let me know if you need further clarification!

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!