My workplace shares a rota file and there is times when someone else already has the file open in edit and I may open it in read-only. Then at some point in the day I may make some changes, forgetting that I am in read-only mode. When I come to close the file at the end of the day it asks if I want to save. Of course, if I now click yes then I need to save as a new file name. The problem here is if the other person in the file has made changes then they need to remember everything they have done so we can merge both sets of changes together and keep the one file. It's highly likely that one of use will not remember everything we have which leads to confusion.

To avoid the above happening, is there some code I can add to a workbook that alerts the user that the file is in read-only mode if they try to edit any cells?