Загрузка страницы

Tutorial - Password Protect Macro

In this tutorial we outline how you can password protect your macro so that a user must enter the correct password before they can execute the macro in the workbook.

The beginners guide can be located here if you struggled with any of the content.

http://twoperscent.com/index.php/excel-macros-beginners-complete-guide/

The written tutorial the accompanies this video can be found at the link below.

http://twoperscent.com/index.php/2017/02/15/password-protect-macro-tutorial/

The code that we used in this tutorial is as follows.

Private Sub CommandButton1_Click()

Dim password As Variant

password = Application.InputBox("Please Enter Password", "Password Protected Macro")

Select Case password

Case Is = False

'do nothing

Case Is = "password"

Sheets("Sheet1").Range("A4").Select

ActiveCell.EntireRow.Insert shift:=xlDown

Sheets("Sheet1").Range("A4:E4").Select

Selection.Borders.Weight = xlThin

Case Else

MsgBox "The password you entered was incorrect"

End Select

End Sub

I hope this has been helpful. For a cleaned up version of the VBA code please visit the written guide.

Видео Tutorial - Password Protect Macro канала Twoperscent
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
16 февраля 2017 г. 0:49:54
00:05:51
Яндекс.Метрика