+ Reply to Thread
Results 1 to 7 of 7

Find Cells with Formulas, Range on Active Worksheet and Lock them

  1. #1
    Registered User
    Join Date
    02-17-2021
    Location
    Helsinki, Finland
    MS-Off Ver
    365
    Posts
    31

    Find Cells with Formulas, Range on Active Worksheet and Lock them

    Create a VBA .

    - On an Active Worksheet
    - Range ("C1:D258")
    - Unlock all the cells within that Range.
    - Finds cells with Formulas within that Range.
    - Locks the Cells with Formulas
    - Does not require a password (no protection).

    The aim is to protect the sheet so that users can insert information on cells but have no access to the cells which has formulas. Once I have manually locked the Sheet, they can only access the unlocked cells.

    I have been trying to implement a code, but not successfully. Hope to get some help.
    Thank you.
    Last edited by Tsinos; 01-23-2023 at 01:33 PM.

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: Find Cells with Formulas, Range on Active Worksheet and Lock them


    As by default all the cells are locked …

  3. #3
    Registered User
    Join Date
    02-17-2021
    Location
    Helsinki, Finland
    MS-Off Ver
    365
    Posts
    31

    Re: Find Cells with Formulas, Range on Active Worksheet and Lock them

    I have not realized that. Thank you for your remark, I edited the question accordingly.

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Post Re: Find Cells with Formulas, Range on Active Worksheet and Lock them


    (removed, misread)

  5. #5
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Try this !


    A VBA demonstration as a beginner starter :

    PHP Code: 
    Sub Demo1()
        
    With [C1:D258]
            .
    Locked False
            
    .SpecialCells(xlCellTypeFormulas).Locked True
        End With
    End Sub 
    ► Do you like it ? ► So thanks to click on bottom left star icon « Add Reputation » !

  6. #6
    Registered User
    Join Date
    02-17-2021
    Location
    Helsinki, Finland
    MS-Off Ver
    365
    Posts
    31

    Re: Try this !

    Wow - you just blew my mind! I did not even know that PHP can also be used on Excel. That only proves 1) how little I know about Excel 2) how powerful tool Excel is.
    @Marc L, thank you so much for the code. It works perfectly!

  7. #7
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: Find Cells with Formulas, Range on Active Worksheet and Lock them


    No you misread as I wrote « A VBA demonstration » no nothing to do with the PHP code tags …

    Thanks for the rep' !

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 10-28-2022, 01:51 PM
  2. Replies: 4
    Last Post: 07-03-2015, 04:27 AM
  3. [SOLVED] Copy/paste range of cells to first empty row of active list in another worksheet
    By wildecat666 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-06-2013, 03:45 PM
  4. find number of data in a range IGNORE FORMULAS, BLANK cells
    By ccsmith in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-07-2013, 11:57 AM
  5. Lock particular column with hiding formulas with other columns being active
    By sanjeevkumarmc in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-23-2012, 01:45 AM
  6. Can I lock cells or do I have to lock the worksheet?
    By jmbtexas in forum Excel General
    Replies: 4
    Last Post: 11-11-2008, 02:26 PM
  7. Search a range to find cells containing formulas
    By tanktata in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-07-2006, 11:41 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1