Proteger varias hojas al mismo tiempo en Excel

La siguiente macro resuelve el problema cuando tenemos varias hojas de trabajo y tenemos la necesidad de proteger todas. Dada la misma situación, pero para desprotegerlas.

Sub protect_all()
    For Each sht In ActiveWorkbook.Sheets
        sht.Protect Password:="test"
    Next sht
End Sub
'
Sub unprotec_all()
    For Each sht In ActiveWorkbook.Sheets
        sht.Unprotect Password:="test"
    Next sht
End Sub

Ver video Proteger hojas en Excel usando macros VBA

Suscríbete al canal de EXCELeINFO en YouTube para aprender más de Excel y macros.

You may also like...

5 Responses

  1. Tony says:

    Me funcionó hermano, justo lo que necesitaba, GRACIAS.

  2. Walter says:

    Estimado Sergio

    Funciona correctamente y me fue de muchisima utilidad.

    GRACIAS.

  3. David0800 says:

    EXCELENTE!!!!!!!!!!

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: