Intento que esta macro me proteja todas las hojas y me active el autofiltro en todas las hojas, pero solo me activa el autofiltro en la hoja activa, en el resto no.
¿Me podeis ayudar?
estoy bloqueado...
Sub Proteger_libro()
On Error GoTo fin
Dim sht As Worksheet
Application.ScreenUpdating = False
ActiveWorkbook.Protect ("contraseña")
For Each sht In ActiveWorkbook.Worksheets
If sht.Visible = True Then
sht.Protect ("contraseña")
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowFiltering:=True
End If
Next
fin:
End Sub
gracias y un saludo
Featured Replies
Archivado
Este tema está ahora archivado y está cerrado a más respuestas.
Hola a todos
Intento que esta macro me proteja todas las hojas y me active el autofiltro en todas las hojas, pero solo me activa el autofiltro en la hoja activa, en el resto no.
¿Me podeis ayudar?
estoy bloqueado...
Sub Proteger_libro()
On Error GoTo fin
Dim sht As Worksheet
Application.ScreenUpdating = False
ActiveWorkbook.Protect ("contraseña")
For Each sht In ActiveWorkbook.Worksheets
If sht.Visible = True Then
sht.Protect ("contraseña")
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowFiltering:=True
End If
Next
fin:
End Sub
gracias y un saludo