Macro no funciona
Publicado por lursaildi (16 intervenciones) el 29/06/2015 19:05:49
Tengo la siguiente macro pero no me funciona con la hoja bloqueada pero si funciona si la desbloqueo a mano antes de activar macro , cual puede ser el error ya que teoricamente esta macro esta preparada para desbloquear al entrar la macro y volver a bloquear cuando termine la macro.
Gracias por anticipado
Gracias por anticipado
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Sub Desbloquear()
Sheets("Peticion Ensayos").Select 'Selecciona la Hoja1
ActiveSheet.Unprotect 'Desprotege la hoja activa. Sin contraseña
End Sub
Public Sub OcultarLineasVacias()
Dim rng As Range
Dim intLastCol As Integer
Dim intLastRow As Integer
Dim blnEmptyRow As Boolean
Dim i As Integer
Dim j As Integer
Set rng = Selection.SpecialCells(xlCellTypeLastCell)
intLastCol = rng.Column
intLastRow = rng.Row
For i = 1 To intLastRow
blnEmptyRow = True
For j = 1 To intLastCol
If Cells(i, j).Value <> "" Then
blnEmptyRow = False
Exit For
End If
Next
If blnEmptyRow Then
Cells(i, j).EntireRow.Hidden = True
End If
Next
End Sub
Sub Protejer()
Sheets("Peticion Ensayos").Select 'Selecciona la Hoja1
ActiveSheet.Protect 'Protege la hoja activa.
End Sub
Valora esta pregunta


0