Visual Basic - sedeo proteger la hoja y me tira erro 1004 que debo de cambiar

Life is soft - evento anual de software empresarial
 
Vista:

sedeo proteger la hoja y me tira erro 1004 que debo de cambiar

Publicado por Rigoberto (1 intervención) el 10/02/2014 18:56:14
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
Sub Add_Control()
    Dim miCelda As Range
    Dim FilaLibre As Long
    Dim tipoMov As String
 
    Set miCelda = [datos]
    FilaLibre = ActiveSheet.Cells(65536, miCelda.Column).End(xlUp).Row + 1
 
    tipoMov = Application.Caller ' bEntrada o bSalida, según el botón pulsado
 
    If tipoMov = "bEntrada" Then
        ' Buscar primera fila libre y rellenar
        FilaLibre = ActiveSheet.Cells(65536, miCelda.Column).End(xlUp).Row + 1
        ActiveSheet.Cells(FilaLibre, miCelda.Column).Value = [codemp]
        ActiveSheet.Cells(FilaLibre, miCelda.Column).Offset(0, 1).Value = [nomemp]
        ActiveSheet.Cells(FilaLibre, miCelda.Column).Offset(0, 2).Value = Now()
    Else
        ' Buscar la última entrada de este empleado que no tenga hora de salida y rellenar
        Do While FilaLibre > [datos].Row
            FilaLibre = FilaLibre - 1
            If ActiveSheet.Cells(FilaLibre, miCelda.Column).Value = [codemp] Then
                If ActiveSheet.Cells(FilaLibre, miCelda.Column).Offset(0, 3).Value = "" Then
                    ActiveSheet.Cells(FilaLibre, miCelda.Column).Offset(0, 3).Value = Now()
                    Exit Do
                End If
            End If
        Loop
    End If
 
End Sub
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder