Horje
excel protect cells with formulas Code Example
excel protect cells with formulas
' Protects cells containing formulas, with password
' pPwd: password to protect / unprotect
Sub ProtectFormulas(ByRef pRange As Range, ByVal pPwd As String)
    ActiveSheet.Unprotect pPwd
    For Each r In pRange
        r.Locked = IIf(r.HasFormula, True, False)
    Next r
    ActiveSheet.Protect pPwd
End Sub

Sub TestIt()
    ProtectFormulas Range("A1:B4"), "MyPassWord"
End Sub




Vb

Related
excel vba protect cells with formula Code Example excel vba protect cells with formula Code Example
vba text to general Code Example vba text to general Code Example
excel named range sum Code Example excel named range sum Code Example
excel vba hide columns Code Example excel vba hide columns Code Example
excel vba open browser Code Example excel vba open browser Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8