Sub AgregarRegistroDiario()
Dim Fila As Long, Last_Row As Integer
Sheets("Registro").Visible = True
Sheets("Registro").Select
ActiveSheet.Unprotect
' ---&--- Mira si hay datos para agregar
Fila = 3
If Cells(Fila, "A") = "" Then
MsgBox "No hay datos para agregar", vbCritical, "SIN DATOS"
Exit Sub
End If
' ---&--- Cuenta el número de lineas
While Fila <= 17 And Cells(Fila + 1, "D") <> ""
Fila = Fila + 1
Wend
' ---&--- Copia las líneas
Range("A3:L" & Fila).Select
Selection.Copy
' ---&--- Busca la primera fila Vacia
Last_Row = 24
While Cells(Last_Row, "D") <> ""
Last_Row = Last_Row + 1
Wend
' ---&--- pega los Datos
Range("A" & Last_Row).Select
Selection.PasteSpecial Paste:=xlPasteValues, _
Operation:=xlNone, _
SkipBlanks:=False, _
Transpose:=False
' ---&--- Deja las filas ocultas
Range("B3,D3,I3,D4:D17").Select
Range("B3,D3,I3,D4:D17").Activate
Selection.ClearContents
ActiveSheet.Unprotect
Range("D4:D17").Select
Selection.Locked = True
Selection.FormulaHidden = False
Rows("4:17").Select
Selection.EntireRow.Hidden = True
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Range("B3").Select
End Sub