Hoja de trabajo protegida con contraseña: código VBA para proteger la hoja de trabajo con contraseña al cerrar

Código VBA para proteger la hoja de trabajo con contraseña al cerrar
Tabla de contenido

Password Protect Worksheet on Close with VBA (with Images)

Qué Lo es:

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

RevisarProtect Sheet and then Ahorrar workbook.

Password Protect

Por qué Lo es:

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.

Cómo to password protect with VBA upon Close:

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




Paso 2: copie y pegue el siguiente código en la ventana del editor de VBA y guarde el libro.

Sub privado 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

Subtítulo final

Nota: 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 antonio
Anson es autor colaborador y fundador de www.askeygeek.com. Aprender algo nuevo siempre ha sido su pasión, ASKEYGEEK.com es el resultado de su pasión por la tecnología y los negocios. Tiene una década de experiencia versátil en subcontratación de procesos comerciales, finanzas y contabilidad, tecnología de la información, excelencia operativa e inteligencia empresarial. Durante su mandato, trabajó para organizaciones como Genpact, Hewlett Packard, M*Modal y Capgemini en diversos roles y responsabilidades. Fuera de los negocios y la tecnología, es un cinéfilo que pasa horas juntos viendo y aprendiendo cine, ¡y también es un cineasta!

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

¡Felicidades!
Lo hiciste,
¡No cierres!

Acceso UberCreate Creator Pro
¡¡¡gratis!!!

Esta ventana emergente no se mostrará tú decides de nuevo!!!

Share to...