Posts by royUK

    I found this some time ago, but I can't locate where now. I've not tried it


    Welcome to the Forum. Please read the Forum Rules to understand how the Forum works and why I have added Code Tags to your post


    All VBA code posted in the forum must be wrapped in code tags, which you omitted, including single-line code snippets.Be sure to use them in future posts.


    How to use code tags


    Just highlight all of the code and press the <> in the post menu above button to add the code tags.


    Thanks.


    Cross-posting is when you post the same question in other forums on the web. You'll find people are disinclined to respond to cross-posts because they may be wasting their time solving a problem that has been solved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the URL from the address bar in your browser) to the cross-post. We are here to help so help us help you!




    Read this to understand why we ask you to do this



    https://www.excelguru.ca/content.php?184


    It's good that received a solution. To close this thread, please either add your answer and accept it as an answer: this could help others or you might get a better answer.


    Three rules broken, not a good start!!. READ THE FORUM RULES BEFORE POSTING AGAIN - you will find that all Excel Forums have similar rules.

    The fastest way ts to utilise AutoFilter


    You might find this a little better, especially the error handlers to prevent events remaining off in case of an error, events will not reset automatically.


    Welcome to the Forum. Please read the Forum Rules to understand how the Forum works and why I have added Code Tags to your post


    All VBA code posted in the forum must be wrapped in code tags, which you omitted, including single-line code snippets.Be sure to use them in future posts.


    How to use code tags


    Just highlight all of the code and press the <> in the post menu above button to add the code tags.


    Thanks.

    What do you think the code is doing? This code actually does nothing but check if a cell is empty.


    Code
    1. For Each MyCell In Rng
    2. If MyCell.Value = "" Then


    The code loops through the cells and if it finds a cell that isn't blank it locks it unprotects the sheet , locks the cell then protects the sheet. That is unnecessary. What is expected to be in cells - formulas, numbers or text? or text


    This will find and lock all cells containing text in the range.