Created
January 23, 2018 20:37
-
-
Save lporras/f6eb24199ba6aa1fb1dfba293acf7dc1 to your computer and use it in GitHub Desktop.
Lock & UnLock Cells visual basic
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub unlockCells() | |
' | |
' unlockcell Macro | |
' | |
' Método abreviado de teclado: Opción+Cmd+e | |
' | |
Dim chRng As Range | |
Worksheets("Sheet2").Unprotect ("password") | |
Set chRng = Worksheets("Sheet2").Range("E1:E100") | |
For Each chCell In chRng.Cells | |
chCell.Locked = False | |
Next chCell | |
Worksheets("Sheet2").Protect ("password") | |
End Sub | |
Sub lockCells() | |
' | |
' unlockcell Macro | |
' | |
' Método abreviado de teclado: Opción+Cmd+e | |
' | |
Dim chRng As Range | |
Worksheets("Sheet2").Unprotect ("password") | |
Set chRng = Worksheets("Sheet2").Range("E1:E100") | |
For Each chCell In chRng.Cells | |
chCell.Locked = True | |
Next chCell | |
Worksheets("Sheet2").Protect ("password") | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment