Arkusz ochrony hasłem: Kod VBA chroniący arkusz hasłem po zamknięciu

Kod VBA chroniący arkusz hasłem przy zamykaniu
Spis treści

Password Protect Worksheet on Close with VBA (with Images)

Co czy to:

When you want others to only view the workbook data and no editing should be permitted then you have to make sure you protect the workbook with password while closing it. So that even if someone tries to edit the data it will ask for the password unless they input the password data will not be editable.

The manual way of doing the same is

RecenzjaProtect Sheet and then Ratować workbook.

Password Protect

Dlaczego czy to:

If you make frequent updates in the workbook then Every time when you make changes in the workbook you have to make sure you protect it while closing. Some day if you forget to protect then the data will be editable by others.

The below VBA code will help you to protect the workbook automatically while closing the workbook. That means you don’t have to protect it manually everything when you make changes in the workbook.

Jak to password protect with VBA upon Close:

Step 1: Open the workbook that need to be protected and press Alt + F11




Krok 2: Skopiuj i wklej poniższy kod w oknie edytora VBA i zapisz skoroszyt.

Private Sub Workbook_BeforeClose(Cancel As Boolean)

Sheets(“Sheet1″).Protect Password:=”Your Password Here”   ‘Replace “Sheet1” with your sheet name and “Your Password Here” with the password of your choice.

ActiveWorkbook.Save

Napis końcowy

Notatka: Workbook should be saved in a macro enabled format (.xlm, .xlsm, .xlsb etc.) also make sure you protect the VBA code as well. 🙂

That’s It Now Onward your Data will be Safe Always!!

Picture of Anson Antony
Anson Antoni
Anson jest współautorem i założycielem w www.askeygeek.com. Uczenie się czegokolwiek nowego zawsze było jego pasją, ASKEYGEEK.com jest wynikiem jego pasji do technologii i biznesu. Posiada dziesięcioletnie wszechstronne doświadczenie w outsourcingu procesów biznesowych, finansach i księgowości, technologiach informatycznych, doskonałości operacyjnej i inteligencji biznesowej. W trakcie swojej kadencji pracował dla takich organizacji jak Genpact, Hewlett Packard, M*Modal i Capgemini, zajmując różne role i obowiązki. Poza biznesem i technologią jest miłośnikiem kina, który spędza razem godziny, oglądając i ucząc się kina, a także Twórcy Filmowego!

Dodaj komentarz

Twój adres e-mail nie zostanie opublikowany. Wymagane pola są oznaczone *

Gratulacje!
Zrobiłeś to,
Nie zamykaj!

Wstań do 60 000 Kredyty postaci UberTTS za darmo!!!

To wyskakujące okienko nie pokaże zależy od Ciebie Ponownie!!!

UberTTS
Share to...