{"id":6687,"date":"2024-12-21T15:56:23","date_gmt":"2024-12-21T15:56:23","guid":{"rendered":"https:\/\/blog.ezworkapp.com\/index.php\/2024\/12\/21\/cach-thiet-lap-password-de-bao-ve-nhung-trang-an-trong-excel\/"},"modified":"2024-12-21T15:56:23","modified_gmt":"2024-12-21T15:56:23","slug":"cach-thiet-lap-password-de-bao-ve-nhung-trang-an-trong-excel","status":"publish","type":"post","link":"https:\/\/blog.ezworkapp.com\/index.php\/2024\/12\/21\/cach-thiet-lap-password-de-bao-ve-nhung-trang-an-trong-excel\/","title":{"rendered":"C\u00e1ch thi\u1ebft l\u1eadp password \u0111\u1ec3 b\u1ea3o v\u1ec7 nh\u1eefng trang \u1ea9n trong Excel"},"content":{"rendered":"<div class=\"uk-panel uk-margin\" id=\"template-dQf5b79p#1\">\n<p>Trong b\u00e0i vi\u1ebft n\u00e0y, H\u1ecdc Excel Online s\u1ebd h\u01b0\u1edbng d\u1eabn c\u00e1ch b\u1ea3o v\u1ec7 nh\u1eefng trang t\u00ednh \u1ea9n trong Excel b\u1eb1ng Password.<\/p>\n<p><strong>Thi\u1ebft l\u1eadp password b\u1ea3o v\u1ec7 trang t\u00ednh \u1ea9n v\u1edbi ch\u1ee9c n\u0103ng VeryHidden<\/strong><\/p>\n<p>Th\u00f4ng th\u01b0\u1eddng, b\u1ea1n c\u00f3 th\u1ec3 d\u00f9ng h\u00e0m <strong>VeryHidden<\/strong> \u0111\u1ec3 \u1ea9n trang tr\u01b0\u1edbc, sau \u0111\u00f3 m\u1edbi thi\u1ebft l\u1eadp password cho ch\u00fang. H\u00e3y l\u00e0m nh\u01b0 sau:<\/p>\n<p>1. M\u1edf b\u1ea3ng t\u00ednh, nh\u1ea5n ALT+F11 \u0111\u1ec3 m\u1edf c\u1eeda s\u1ed5 <strong>Microsoft Visual Basic for Applications<\/strong>.<\/p>\n<p>2. Trong c\u1eeda s\u1ed5 <strong>Microsoft Visual Basic for Applications, <\/strong>nh\u1ea5n <strong>View<\/strong> &gt; <strong>Project Explorer<\/strong> v\u00e0\u00a0<strong>Properties Window<\/strong> \u0111\u1ec3 m\u1edf h\u1ed9p tho\u1ea1i.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"http:\/\/blog.ezworkapp.com\/wp-content\/uploads\/2024\/12\/doc-protect-hidden-sheets-01.png\" alt=\"doc-protect-hidden-sheets-01\" width=\"530\" height=\"493\" title=\"doc-protect-hidden-sheets-01\"><\/p>\n<p>3. Trong c\u1eeda s\u1ed5 tho\u1ea1i <strong>Project-VBAProject<\/strong>, ch\u1ecdn trang t\u00ednh b\u1ea1n mu\u1ed1n \u1ea9n, \u1edf ph\u1ea7n <strong>Properties<\/strong> c\u1ee7a trang t\u00ednh, nh\u1ea5n m\u0169i t\u00ean \u0111\u1ec3 m\u1edf danh s\u00e1ch t\u00f9y ch\u1ecdn trong ph\u1ea7n <strong>Visible<\/strong>, ch\u1ecdn <strong>xlSheetVeryHidden<\/strong>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"http:\/\/blog.ezworkapp.com\/wp-content\/uploads\/2024\/12\/doc-protect-hidden-sheets-02.png\" alt=\"doc-protect-hidden-sheets-02\" width=\"381\" height=\"543\" title=\"doc-protect-hidden-sheets-02\"><\/p>\n<div class=\"code-block code-block-2\" style=\"margin: 8px 0;clear: both\">\n<div class=\"ad-inserterpro\">\n<a href=\"https:\/\/hocexcel.online\/course\/preview\/vba101-tu-dong-hoa-excel-voi-lap-trinh-vba-cho-nguoi-moi-bat-dau\"><br \/>\n<img decoding=\"async\" src=\"http:\/\/blog.ezworkapp.com\/wp-content\/uploads\/2024\/12\/vba101_92019-nho-262.gif\" title=\"vba101_92019-nho-262\"><br \/>\n<\/a>\n<\/div>\n<\/div>\n<div class=\"code-block code-block-1\" style=\"margin: 8px 0;clear: both\">\n<div class=\"ad-inserterpro\">\n<a href=\"https:\/\/hocexcel.online\/course\/preview\/ex101-excel-tu-co-ban-den-chuyen-gia-danh-cho-nguoi-di-lam\"><br \/>\n<img decoding=\"async\" src=\"http:\/\/blog.ezworkapp.com\/wp-content\/uploads\/2024\/12\/ex101_92019-nho-600.gif\" title=\"ex101_92019-nho-600\"><br \/>\n<\/a>\n<\/div>\n<\/div>\n<p>4. Sau khi \u1ea9n trang t\u00ednh, b\u1ea1n c\u00f3 th\u1ec3 t\u1ea1o password cho ch\u00fang. Trong c\u1ee7a s\u1ed5 <strong>Microsoft Visual Basic for Applications<\/strong>, nh\u1ea5n <strong>Insert<\/strong> &gt; <strong>Module<\/strong> \u0111\u1ec3 m\u1edf m\u1ed9t module m\u1edbi, nh\u1ea5n <strong>Tools<\/strong> &gt; <strong>VBAProject Properties<\/strong>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"http:\/\/blog.ezworkapp.com\/wp-content\/uploads\/2024\/12\/doc-protect-hidden-sheets-03.png\" alt=\"doc-protect-hidden-sheets-03\" width=\"570\" height=\"271\" title=\"doc-protect-hidden-sheets-03\"><\/p>\n<p>5. Trong h\u1ed9p tho\u1ea1i <strong>VBAProject-Project Properties<\/strong>, ch\u1ecdn tab <strong>Protection<\/strong>, \u0111\u00e1nh d\u1ea5u <strong>Lock project for viewing<\/strong>, cu\u1ed1i c\u00f9ng, nh\u1eadp v\u00e0 x\u00e1c nh\u1eadn password trong ph\u1ea7n <strong>Password to view project properties.<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"http:\/\/blog.ezworkapp.com\/wp-content\/uploads\/2024\/12\/doc-protect-hidden-sheets-04.png\" alt=\"doc-protect-hidden-sheets-04\" width=\"438\" height=\"393\" title=\"doc-protect-hidden-sheets-04\"><\/p>\n<p>6. Nh\u1ea5n OK v\u00e0 tho\u00e1t c\u1eeda s\u1ed5, \u0111\u00f3ng c\u1eeda s\u1ed5 <strong>Microsoft Visual Basic for Applications<\/strong>.<\/p>\n<p>7. L\u01b0u b\u1ea3ng t\u00ednh d\u01b0\u1edbi d\u1ea1ng <strong>Excel Macro-Enabled Workbook<\/strong> v\u00e0 \u0111\u00f3ng n\u00f3.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7142\" src=\"http:\/\/blog.ezworkapp.com\/wp-content\/uploads\/2024\/12\/4-10.png\" width=\"600\" height=\"356\" title=\"4-10\"><\/p>\n<p>8. V\u00e0o l\u1ea7n m\u1edf b\u1ea3ng t\u00ednh ti\u1ebfp theo, n\u1ebfu mu\u1ed1n hi\u1ec3n th\u1ecb nh\u1eefng trang t\u00ednh \u0111\u00e3 \u1ea9n, b\u1ea1n ph\u1ea3i nh\u1eadp password.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7143\" src=\"http:\/\/blog.ezworkapp.com\/wp-content\/uploads\/2024\/12\/untitled-32.png\" width=\"600\" height=\"291\" title=\"untitled-32\"><\/p>\n<p><strong>Thi\u1ebft l\u1eadp password \u0111\u1ec3 \u1ea9n trang t\u00ednh b\u1eb1ng m\u00e3 VBA<\/strong><\/p>\n<p>\u0110\u1ec3 thi\u1ebft l\u1eadp password cho trang \u1ea9n, b\u1ea1n c\u0169ng c\u00f3 th\u1ec3 d\u00f9ng m\u00e3 VBA:<\/p>\n<p>1. \u1ea8n trang t\u00ednh b\u1ea1n mu\u1ed1n.<\/p>\n<p>2. Nh\u1ea5n ALT+F11 \u0111\u1ec3 m\u1edf c\u1eeda s\u1ed5 <strong>Microsoft Visual Basic for Applications<\/strong>.<\/p>\n<p>3. Ch\u1ecdn\u00a0<strong>ThisWorkbook<\/strong> t\u1eeb\u00a0<strong>Project Explorer<\/strong>, nh\u1ea5n chu\u1ed9t 2 l\u1ea7n \u0111\u1ec3 m\u1edf <strong>Module<\/strong>, d\u00e1n v\u00e0o \u0111o\u1ea1n m\u00e3 sau<\/p>\n<div class=\"container\">\n<div class=\"line number1 index0 alt2\"><code class=\"vb keyword\">Private<\/code> <code class=\"vb keyword\">Sub<\/code> <code class=\"vb plain\">Workbook_SheetActivate(<\/code><code class=\"vb keyword\">ByVal<\/code> <code class=\"vb plain\">Sh <\/code><code class=\"vb keyword\">As<\/code> <code class=\"vb keyword\">Object<\/code><code class=\"vb plain\">)<\/code><\/div>\n<div class=\"line number2 index1 alt1\"><code class=\"vb keyword\">Dim<\/code> <code class=\"vb plain\">xSheetName <\/code><code class=\"vb keyword\">As<\/code> <code class=\"vb keyword\">String<\/code><\/div>\n<div class=\"line number3 index2 alt2\"><code class=\"vb plain\">xSheetName = <\/code><code class=\"vb string\">\"Sheet1\"<\/code><\/div>\n<div class=\"line number4 index3 alt1\"><code class=\"vb keyword\">If<\/code> <code class=\"vb plain\">Application.ActiveSheet.Name = xSheetName <\/code><code class=\"vb keyword\">Then<\/code><\/div>\n<div class=\"line number5 index4 alt2\"><code class=\"vb spaces\">\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"vb plain\">Application.EnableEvents = <\/code><code class=\"vb keyword\">False<\/code><\/div>\n<div class=\"line number6 index5 alt1\"><code class=\"vb spaces\">\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"vb plain\">Application.ActiveSheet.Visible = <\/code><code class=\"vb keyword\">False<\/code><\/div>\n<div class=\"line number7 index6 alt2\"><code class=\"vb spaces\">\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"vb plain\">xTitleId = <\/code><code class=\"vb string\">\"KutoolsforExcel\"<\/code><\/div>\n<div class=\"line number8 index7 alt1\"><code class=\"vb spaces\">\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"vb plain\">response = Application.InputBox(<\/code><code class=\"vb string\">\"Password\"<\/code><code class=\"vb plain\">, xTitleId, <\/code><code class=\"vb string\">\"\"<\/code><code class=\"vb plain\">, Type:=2)<\/code><\/div>\n<div class=\"line number9 index8 alt2\"><code class=\"vb spaces\">\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"vb keyword\">If<\/code> <code class=\"vb plain\">response = <\/code><code class=\"vb string\">\"123456\"<\/code> <code class=\"vb keyword\">Then<\/code><\/div>\n<div class=\"line number10 index9 alt1\"><code class=\"vb spaces\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"vb plain\">Application.Sheets(xSheetName).Visible = <\/code><code class=\"vb keyword\">True<\/code><\/div>\n<div class=\"line number11 index10 alt2\"><code class=\"vb spaces\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"vb plain\">Application.Sheets(xSheetName).<\/code><code class=\"vb keyword\">Select<\/code><\/div>\n<div class=\"line number12 index11 alt1\"><code class=\"vb spaces\">\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"vb keyword\">End<\/code> <code class=\"vb keyword\">If<\/code><\/div>\n<div class=\"line number13 index12 alt2\"><code class=\"vb keyword\">End<\/code> <code class=\"vb keyword\">If<\/code><\/div>\n<div class=\"line number14 index13 alt1\"><code class=\"vb plain\">Application.Sheets(xSheetName).Visible = <\/code><code class=\"vb keyword\">True<\/code><\/div>\n<div class=\"line number15 index14 alt2\"><code class=\"vb plain\">Application.EnableEvents = <\/code><code class=\"vb keyword\">True<\/code><\/div>\n<div class=\"line number16 index15 alt1\"><code class=\"vb keyword\">End<\/code> <code class=\"vb keyword\">Sub<\/code><\/div>\n<div class=\"line number16 index15 alt1\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7144\" src=\"http:\/\/blog.ezworkapp.com\/wp-content\/uploads\/2024\/12\/12-8.png\" width=\"600\" height=\"329\" title=\"12-8\"><\/div>\n<div class=\"line number16 index15 alt1\"><\/div>\n<div class=\"line number16 index15 alt1\"><strong>Ch\u00fa \u00fd: <\/strong>Trong \u0111o\u1ea1n m\u00e3 tr\u00ean, <strong>Sheet1<\/strong> trong <strong>xSheetName = \u201cSheet1\u201d<\/strong> l\u00e0 t\u00ean trang t\u00ednh b\u1ecb \u1ea9n m\u00e0 b\u1ea1n mu\u1ed1n thi\u1ebft l\u1eadp b\u1ea3o v\u1ec7, v\u00e0 <strong>123456<\/strong> trong <strong>If response = \u201c123456\u201d Then<\/strong> l\u00e0 password. B\u1ea1n c\u00f3 th\u1ec3 thay \u0111\u1ed5i ch\u00fang theo nhu c\u1ea7u.<\/div>\n<div class=\"line number16 index15 alt1\">4. B\u00e2y gi\u1edd n\u1ebfu mu\u1ed1n hi\u1ec3n th\u1ecb trang t\u00ednh \u1ea9n, m\u1ed9t h\u1ed9p tho\u1ea1i hi\u1ec7n ra y\u00eau c\u1ea7u nh\u1eadp password. H\u1ed9p tho\u1ea1i n\u00e0y hi\u1ec7n ra m\u1ed7i khi b\u1ea1n nh\u1ea5p xem trang t\u00ednh \u1ea9n.<\/div>\n<\/div>\n<\/div>\n<div class=\"uk-panel uk-margin uk-width-xlarge\">\n<p>Click \u0111\u0103ng k\u00fd h\u1ecdc t\u1ea1i:<\/p>\n<p><a href=\"http:\/\/blog.ezworkapp.com\/khoa-hoc\" target=\"_blank\" rel=\"noopener\">T\u1ea5t c\u1ea3 kho\u00e1 h\u1ecdc\u00a0<span>\ud83d\udcd6<\/span><\/a><\/p>\n<p><a href=\"http:\/\/blog.ezworkapp.com\/huong-dan-kich-hoat-khoa-hoc-tai-hoc-excel-online.html\" target=\"_blank\" rel=\"noopener\">H\u01b0\u1edbng d\u1eabn k\u00edch ho\u1ea1t<\/a><\/p>\n<p>HKD H\u1ecdc Excel Online<br \/>S\u1ed1 \u0110K: 17A80048102<\/p>\n<\/div>\n<div class=\"uk-panel uk-text-small uk-margin uk-margin-remove-bottom uk-text-center\">\n<p>\u00a9  document.currentScript.insertAdjacentHTML(&#8216;afterend&#8217;, &#8221; + new Intl.DateTimeFormat(document.documentElement.lang, {year: &#8216;numeric&#8217;}).format() + &#8221;);  H\u1ecdc Excel Online. All rights reserved.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<div class=\"ad-inserterpro\">\n<a href=\"https:\/\/hocexcel.online\/course\/preview\/vba101-tu-dong-hoa-excel-voi-lap-trinh-vba-cho-nguoi-moi-bat-dau\"><br \/>\n<img decoding=\"async\" src=\"http:\/\/blog.ezworkapp.com\/wp-content\/uploads\/2024\/12\/vba101_92019-nho-262.gif\"><br \/>\n<\/a>\n<\/div>\n","protected":false},"author":1,"featured_media":6688,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-6687","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-excel-nang-cao"],"_links":{"self":[{"href":"https:\/\/blog.ezworkapp.com\/index.php\/wp-json\/wp\/v2\/posts\/6687","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ezworkapp.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ezworkapp.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ezworkapp.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ezworkapp.com\/index.php\/wp-json\/wp\/v2\/comments?post=6687"}],"version-history":[{"count":0,"href":"https:\/\/blog.ezworkapp.com\/index.php\/wp-json\/wp\/v2\/posts\/6687\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.ezworkapp.com\/index.php\/wp-json\/wp\/v2\/media\/6688"}],"wp:attachment":[{"href":"https:\/\/blog.ezworkapp.com\/index.php\/wp-json\/wp\/v2\/media?parent=6687"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ezworkapp.com\/index.php\/wp-json\/wp\/v2\/categories?post=6687"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ezworkapp.com\/index.php\/wp-json\/wp\/v2\/tags?post=6687"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}