{"id":15678,"date":"2023-05-15T16:28:10","date_gmt":"2023-05-15T16:28:10","guid":{"rendered":"https:\/\/officetuts.net\/excel\/?p=15678"},"modified":"2024-03-28T11:36:52","modified_gmt":"2024-03-28T11:36:52","slug":"lock-data-validation-in-excel","status":"publish","type":"post","link":"https:\/\/officetuts.net\/excel\/examples\/lock-data-validation-in-excel\/","title":{"rendered":"Lock Data Validation in Excel"},"content":{"rendered":"\n

Locking data validation in Excel is useful to prevent users from changing or deleting the data validation rules you have applied to a cell or range of cells.<\/p>\n\n\n\n

This tutorial shows two techniques for locking data validation in Excel.<\/p>\n\n\n\n

Method #1: Protect the Worksheet to Lock Data Validation in Excel<\/h3>\n\n\n\n

Consider the following dataset with data validation rules applied to cell ranges B2:B10 and C2:C10. The data validation ensures that only specific dates are entered in the cell range B2:B10, and only particular countries are entered in the cell range C2:C10.<\/p>\n\n\n\n

\"Graphical<\/figure>\n\n\n\n

We want to lock data validation rules in the cell ranges B2:B10 and C2:C10.<\/p>\n\n\n\n

We use the steps below:<\/p>\n\n\n\n

    \n
  1. Select the cell range A2:C10 where you want data entry. The range includes the cell range B2:C10 which has data validation rules.<\/li>\n<\/ol>\n\n\n\n
    \"\"<\/figure>\n\n\n\n
      \n
    1. Right-click on the selection and choose Format Cells<\/strong> from the context menu to open the Format Cells<\/strong> dialog box.<\/li>\n<\/ol>\n\n\n\n
      \"Graphical<\/figure>\n\n\n\n

      Alternatively, you can press Ctrl + 1<\/strong>.<\/p>\n\n\n\n

        \n
      1. Click the Protection<\/strong> tab on the Format Cells<\/strong> dialog box, deselect the Locked<\/strong> option, and click OK to unlock the target cell range.<\/li>\n<\/ol>\n\n\n\n
        \"Graphical<\/figure>\n\n\n\n
          \n
        1. Click Review >> Protect >> Protect Sheet<\/strong>.<\/li>\n<\/ol>\n\n\n\n
          \"Graphical<\/figure>\n\n\n\n
            \n
          1. On the Protect Sheet<\/strong> dialog box, uncheck the Select locked cells<\/strong> option, and leave the other options as is.<\/li>\n<\/ol>\n\n\n\n
            \"Graphical<\/figure>\n\n\n\n

            Optionally, specify a password to unlock the worksheet on the Password to unprotect sheet<\/strong> box on top of the dialog box.<\/p>\n\n\n\n

              \n
            1. Click OK.<\/li>\n<\/ol>\n\n\n\n

              Now that the worksheet is protected, users can only enter data in the unlocked cell range and cannot fiddle with the data validation.<\/p>\n\n\n\n

              Method #2: Use Excel VBA to Prevent Paste on Data Validation Cells<\/h3>\n\n\n\n

              We can use Excel VBA to prevent pasting data validation cells and destroying the data validation rules.<\/p>\n\n\n\n

              Suppose we have the following dataset with data validation rules applied to cell ranges B2:B10 and C2:C10. The data validation ensures that only particular dates are entered in the cell range B2:B10, and only specific countries are entered in the cell range C2:C10.<\/p>\n\n\n\n

              \"Graphical<\/figure>\n\n\n\n

              We want to use Excel VBA to prevent pasting over the cell range with data validation.<\/p>\n\n\n\n

              We use the steps below:<\/p>\n\n\n\n

                \n
              1. Right-click the tab of the worksheet containing the dataset and choose View Code<\/strong> on the shortcut menu.<\/li>\n<\/ol>\n\n\n\n
                \"Graphical<\/figure>\n\n\n\n
                  \n
                1. Copy and paste the following code into the worksheet\u2019s code window:<\/li>\n<\/ol>\n\n\n\n
                  Private Sub Worksheet_SelectionChange(ByVal Target As Range)\n    If Not Application.Intersect(Target, Range(\"B2:C10\")) Is Nothing Then\n        Application.CutCopyMode = False\n    End If\nEnd Sub<\/code><\/pre>\n\n\n\n
                    \n
                  1. Save the workbook as an Excel Macro-Enabled Workbook (*.xlsm)<\/strong>.<\/li>\n<\/ol>\n\n\n\n

                    When someone tries to paste on the cells with data validation, they find that they can\u2019t because the Paste Special<\/strong> option is disabled.<\/p>\n\n\n\n

                    \"Graphical<\/figure>\n\n\n\n

                    Conclusion<\/h2>\n\n\n\n

                    This tutorial explained two techniques for locking data validation in Excel. We hope you found the tutorial helpful.<\/p>\n","protected":false},"excerpt":{"rendered":"

                    Locking data validation in Excel is useful to prevent users from changing or deleting the data validation rules you have applied to a…<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[190],"yoast_head":"\nLock Data Validation in Excel<\/title>\n<meta name=\"description\" content=\"Learn how to lock data validation rules in Excel using two different techniques. Prevent changes or deletions to ensure data accuracy.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/officetuts.net\/excel\/examples\/lock-data-validation-in-excel\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Lock Data Validation in Excel\" \/>\n<meta property=\"og:description\" content=\"Learn how to lock data validation rules in Excel using two different techniques. Prevent changes or deletions to ensure data accuracy.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/officetuts.net\/excel\/examples\/lock-data-validation-in-excel\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-05-15T16:28:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-28T11:36:52+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2023\/05\/graphical-user-interface-application-table-exce.png\" \/>\n<meta name=\"author\" content=\"Christopher Sirali\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Christopher Sirali\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/officetuts.net\/excel\/examples\/lock-data-validation-in-excel\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/officetuts.net\/excel\/examples\/lock-data-validation-in-excel\/\"},\"author\":{\"name\":\"Christopher Sirali\",\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/b303a8b219a448ca09f1e9eed3903370\"},\"headline\":\"Lock Data Validation in Excel\",\"datePublished\":\"2023-05-15T16:28:10+00:00\",\"dateModified\":\"2024-03-28T11:36:52+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/officetuts.net\/excel\/examples\/lock-data-validation-in-excel\/\"},\"wordCount\":442,\"publisher\":{\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42\"},\"image\":{\"@id\":\"https:\/\/officetuts.net\/excel\/examples\/lock-data-validation-in-excel\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2023\/05\/graphical-user-interface-application-table-exce.png\",\"keywords\":[\"pinterest\"],\"articleSection\":[\"examples\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/officetuts.net\/excel\/examples\/lock-data-validation-in-excel\/\",\"url\":\"https:\/\/officetuts.net\/excel\/examples\/lock-data-validation-in-excel\/\",\"name\":\"Lock Data Validation in Excel\",\"isPartOf\":{\"@id\":\"https:\/\/officetuts.net\/excel\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/officetuts.net\/excel\/examples\/lock-data-validation-in-excel\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/officetuts.net\/excel\/examples\/lock-data-validation-in-excel\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2023\/05\/graphical-user-interface-application-table-exce.png\",\"datePublished\":\"2023-05-15T16:28:10+00:00\",\"dateModified\":\"2024-03-28T11:36:52+00:00\",\"description\":\"Learn how to lock data validation rules in Excel using two different techniques. Prevent changes or deletions to ensure data accuracy.\",\"breadcrumb\":{\"@id\":\"https:\/\/officetuts.net\/excel\/examples\/lock-data-validation-in-excel\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/officetuts.net\/excel\/examples\/lock-data-validation-in-excel\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/officetuts.net\/excel\/examples\/lock-data-validation-in-excel\/#primaryimage\",\"url\":\"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2023\/05\/graphical-user-interface-application-table-exce.png\",\"contentUrl\":\"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2023\/05\/graphical-user-interface-application-table-exce.png\",\"width\":331,\"height\":236,\"caption\":\"Graphical user interface, application, table, Excel Description automatically generated\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/officetuts.net\/excel\/examples\/lock-data-validation-in-excel\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/officetuts.net\/excel\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Lock Data Validation in Excel\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/officetuts.net\/excel\/#website\",\"url\":\"https:\/\/officetuts.net\/excel\/\",\"name\":\"\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/officetuts.net\/excel\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42\",\"name\":\"Tomasz Decker\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/18cbe22837193574870ae40ba56bf712?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/18cbe22837193574870ae40ba56bf712?s=96&d=mm&r=g\",\"caption\":\"Tomasz Decker\"},\"logo\":{\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/\"},\"description\":\"Spreadsheet and Python enthusiast.\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/b303a8b219a448ca09f1e9eed3903370\",\"name\":\"Christopher Sirali\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/21aaff468311813001dc2723f1937cf0?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/21aaff468311813001dc2723f1937cf0?s=96&d=mm&r=g\",\"caption\":\"Christopher Sirali\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Lock Data Validation in Excel","description":"Learn how to lock data validation rules in Excel using two different techniques. Prevent changes or deletions to ensure data accuracy.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/officetuts.net\/excel\/examples\/lock-data-validation-in-excel\/","og_locale":"en_US","og_type":"article","og_title":"Lock Data Validation in Excel","og_description":"Learn how to lock data validation rules in Excel using two different techniques. Prevent changes or deletions to ensure data accuracy.","og_url":"https:\/\/officetuts.net\/excel\/examples\/lock-data-validation-in-excel\/","article_published_time":"2023-05-15T16:28:10+00:00","article_modified_time":"2024-03-28T11:36:52+00:00","og_image":[{"url":"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2023\/05\/graphical-user-interface-application-table-exce.png"}],"author":"Christopher Sirali","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Christopher Sirali","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/officetuts.net\/excel\/examples\/lock-data-validation-in-excel\/#article","isPartOf":{"@id":"https:\/\/officetuts.net\/excel\/examples\/lock-data-validation-in-excel\/"},"author":{"name":"Christopher Sirali","@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/b303a8b219a448ca09f1e9eed3903370"},"headline":"Lock Data Validation in Excel","datePublished":"2023-05-15T16:28:10+00:00","dateModified":"2024-03-28T11:36:52+00:00","mainEntityOfPage":{"@id":"https:\/\/officetuts.net\/excel\/examples\/lock-data-validation-in-excel\/"},"wordCount":442,"publisher":{"@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42"},"image":{"@id":"https:\/\/officetuts.net\/excel\/examples\/lock-data-validation-in-excel\/#primaryimage"},"thumbnailUrl":"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2023\/05\/graphical-user-interface-application-table-exce.png","keywords":["pinterest"],"articleSection":["examples"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/officetuts.net\/excel\/examples\/lock-data-validation-in-excel\/","url":"https:\/\/officetuts.net\/excel\/examples\/lock-data-validation-in-excel\/","name":"Lock Data Validation in Excel","isPartOf":{"@id":"https:\/\/officetuts.net\/excel\/#website"},"primaryImageOfPage":{"@id":"https:\/\/officetuts.net\/excel\/examples\/lock-data-validation-in-excel\/#primaryimage"},"image":{"@id":"https:\/\/officetuts.net\/excel\/examples\/lock-data-validation-in-excel\/#primaryimage"},"thumbnailUrl":"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2023\/05\/graphical-user-interface-application-table-exce.png","datePublished":"2023-05-15T16:28:10+00:00","dateModified":"2024-03-28T11:36:52+00:00","description":"Learn how to lock data validation rules in Excel using two different techniques. Prevent changes or deletions to ensure data accuracy.","breadcrumb":{"@id":"https:\/\/officetuts.net\/excel\/examples\/lock-data-validation-in-excel\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/officetuts.net\/excel\/examples\/lock-data-validation-in-excel\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/officetuts.net\/excel\/examples\/lock-data-validation-in-excel\/#primaryimage","url":"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2023\/05\/graphical-user-interface-application-table-exce.png","contentUrl":"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2023\/05\/graphical-user-interface-application-table-exce.png","width":331,"height":236,"caption":"Graphical user interface, application, table, Excel Description automatically generated"},{"@type":"BreadcrumbList","@id":"https:\/\/officetuts.net\/excel\/examples\/lock-data-validation-in-excel\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/officetuts.net\/excel\/"},{"@type":"ListItem","position":2,"name":"Lock Data Validation in Excel"}]},{"@type":"WebSite","@id":"https:\/\/officetuts.net\/excel\/#website","url":"https:\/\/officetuts.net\/excel\/","name":"","description":"","publisher":{"@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/officetuts.net\/excel\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42","name":"Tomasz Decker","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/18cbe22837193574870ae40ba56bf712?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/18cbe22837193574870ae40ba56bf712?s=96&d=mm&r=g","caption":"Tomasz Decker"},"logo":{"@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/"},"description":"Spreadsheet and Python enthusiast."},{"@type":"Person","@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/b303a8b219a448ca09f1e9eed3903370","name":"Christopher Sirali","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/21aaff468311813001dc2723f1937cf0?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/21aaff468311813001dc2723f1937cf0?s=96&d=mm&r=g","caption":"Christopher Sirali"}}]}},"_links":{"self":[{"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/posts\/15678"}],"collection":[{"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/comments?post=15678"}],"version-history":[{"count":1,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/posts\/15678\/revisions"}],"predecessor-version":[{"id":15688,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/posts\/15678\/revisions\/15688"}],"wp:attachment":[{"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/media?parent=15678"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/categories?post=15678"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/tags?post=15678"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}