About 32,100 results
Open links in new tab
  1. vba - Lock certain cells in a range - Stack Overflow

    I'm trying to loop through a range of cells, locking any cell that has content while leaving empty cells unlocked. When I run the below code the result is the entire sheet is locked. If I add a...

  2. How to Lock the data in a cell in excel using vba

    Nov 19, 2012 · I want to stop others from editing the cell contents in my excel sheet using VBA. Is it possible to do this?

  3. excel - How to lock specific cells but allow filtering and sorting ...

    Oct 25, 2017 · The thing to understand is that the purpose of locking cells is to prevent them from being changed, and sorting permanently changes cell values. You can write a macro, but a …

  4. Locking specific cells in excel VBA - Stack Overflow

    Oct 13, 2017 · The cells which will be locked are in yellow, if there is a date in column L The reason why locking the whole worksheet wont overcome the problem is because any …

  5. Excel - Lock Range of Cells Based on Values - Stack Overflow

    Aug 10, 2012 · Is it possible to lock a particular range of cells based on the input from a dropdown in a row of data? For example, each row of my spreadsheet represents a patient, and the first …

  6. Locking and protecting selected cells through an Office Script

    Nov 2, 2022 · The code is going to unprotect a document, lock a range of cells that were unlocked (determined by the power automate flow) and then re-protect the document. So far I have …

  7. Protecting cells in Excel but allow these to be modified by VBA script

    May 29, 2018 · 72 I am using Excel where certain fields are allowed for user input and other cells are to be protected. I have used Tools Protect sheet, however after doing this I am not able to …

  8. excel - Using VBA Code to prevent editing in certain cells based …

    Jun 8, 2018 · Based on the selection in that list, I want to have certain areas of the sheet lock and unlock so that the only part of the form they can fill in is pertaining to their selection in D8.

  9. How to lock Excel cells in VBA? - Stack Overflow

    Sep 18, 2013 · This however seems to not be working for my situation :/ Protecting (or "locking") the cells prevents my vba code from changing cell values as users cycle through records. I …

  10. excel - Lock specific cells without knowing Sheet's name - Stack …

    Aug 27, 2025 · 5 Instead of ActiveSheet.Cells(3, 14).Locked = True you should use ws.Cells(3, 14).Locked = True Looping over the worksheets in a workbook doesn't change the …