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
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
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
How to create a website - Step 3 - How to change nameserversCreating a macro in excel that will add a new row into a separate worksheet on ExcelHow to hyperlink a cell to a website in Microsoft ExcelCalculate number of characters in a cell on Excel (Use Length Formula)My experience with a Cloud Mining Service. Is cloud mining worth it?How to create a Gantt Chart in ExcelMacro Tutorial - Hide and Unhide rows in Microsoft Excel (Hide/Unhide VBA code)How to animate a bar chart or graph in Powerpoint (Decrease)Find last cell with data macro tutorial - ExcelExcel Macro which will Save your workbookTutorial - Microsoft Excel Remove DuplicatesHow to write an excel macro/VBA code that makes text italicsHow to change hyperlink colors in ExcelHow to add a line graph within a cell on Microsoft Excel (Sparkline tutorial)Powerpoint seesaw animation tutorialTutorial - Excel Macro Create new sheetHow to change date on a Gantt ChartHow to remove the white background/box of an image (Image Transparency)Macro tutorial - How to delete the last rowHow to hyperlink one cell to another in Microsoft Excel