If you don’t add this line, each time the code tries to merge cells, you will get this message.

In our case, Excel will try to merge cells three times and will display this warning each time.

The next line of code is used to disable screen updating each time Excel merge cells. This line of code will improve the performance greatly if you have a lot of data. In won’t do much in our case.

Application.ScreenUpdating = False

Then, we run the loop
for myRange. This range consists of
a single column, so the next cell will always be the new row.

This line checks whether the cell in the next row is equal to the current cell. It also checks if the cell is not empty, otherwise, the loop would go to the last cell inside the worksheets and the program would crash.