Te anexo las macro actualizadas:
Sub pase_Cargue()
'Act.Por.Dante Amor
Set h3 = Sheets("CARGUE")
h3.Unprotect "1"
'se pasan datos de la factura a la fila libre
u = h3. UsedRange. Rows(h3. UsedRange. Rows. Count). Row
For i = 8 To Rows.Count
If InStr(1, h3.Cells(i, "B"), "TOT") Then
nlin = i
h3.Rows(nlin).Insert Shift:=xlDown, CopyOrigin:=xlFormatFromRightOrBelow
Exit For
End If
Next
h3.Cells(nlin, 1) = Range("E10")
h3.Cells(nlin, 2) = Range("AA3")
h3.Cells(nlin, 3) = Range("AA5")
h3.Cells(nlin, 4) = Range("E9")
h3.Cells(nlin, 5) = Range("A13")
h3.Cells(nlin, 6) = Range("A15")
h3.Cells(nlin, 7) = Range("A17")
h3.Cells(nlin, 8) = Range("A19")
h3.Cells(nlin, 9) = Range("A21")
h3.Cells(nlin, 10) = Range("J13")
M = Range("J15") + Range("J17") + Range("J19") + Range("J21")
h3.Cells(nlin, 11) = M
N = Range("V13") + Range("V15") + Range("V17") + Range("V19")
h3.Cells(nlin, 12) = N
h3.Cells(nlin, 13) = Range("AD21")
h3.Cells(nlin, 14) = Range("H25")
If h3.Range("N" & nlin).Value = "Cuenta Corriente" Then
h3.Cells(nlin, 15) = Range("AC25")
ElseIf h3.Range("N" & nlin).Value = "Contado" Then
h3.Cells(nlin, 16) = Range("AC25")
ElseIf h3.Range("N" & nlin).Value = "Contra Entrega en:" Then
h3.Cells(nlin, 17) = Range("AC25")
End If
If h3.AutoFilterMode Then
h3.Rows(nlin).Hidden = True
End If
h3.Protect "1", DrawingObjects:=True, Contents:=True, _
Scenarios:=True, AllowInsertingRows:=True, AllowDeletingRows:=True, _
AllowSorting:=True, AllowFiltering:=True
End Sub
Sub Borrar_Cargue()
' BORRAR Macro
Set h3 = Sheets("CARGUE")
h3.Unprotect "1"
Sheets("CARGUE").Select
sino = MsgBox("¿Está Seguro de Borrar los Datos?", vbYesNoCancel, "CONFIRMAR")
'si No o Cancel no se ejecuta el resto
If sino = vbCancel Then
Cancel = True
ElseIf sino = vbNo Then Exit Sub
ElseIf sino = vbYes Then
Rem este código borra solo el contenido de la hoja Reporte
Set ho1 = Sheets("CARGUE")
nlin = ho1.Range("A" & Rows.Count).End(xlUp).Row + 1
ho1.Rows(nlin).Insert
ho1.Rows("8:" & nlin).Delete
ActiveSheet.Range("$A$6:$Q$6").AutoFilter Field:=1
ActiveSheet.Range("$A$6:$Q$6").AutoFilter Field:=2
ActiveSheet.Range("$A$6:$Q$6").AutoFilter Field:=3
ActiveSheet.Range("$A$6:$Q$6").AutoFilter Field:=4
Range("A8").Select
End If
If ActiveSheet.FilterMode Then ActiveSheet.ShowAllData
h3.Protect "1", DrawingObjects:=True, Contents:=True, _
Scenarios:=True, AllowInsertingRows:=True, AllowDeletingRows:=True, _
AllowSorting:=True, AllowFiltering:=True
End Sub
':)
':)