Error 1004 en macro cargar asientos

Sub cargar_asiento()
Dim NRO_ASIENTO
' Consistencia de la carga
If Range("H18") = "Asiento Correcto" Then
' COPIANDO CARGA DE DATOS DE ASIENTO
Range("a5:h14").Select
Selection.Copy
' UBICARSE AL FINAL DE LA BASE DE ASIENTOS
Range("b5000").Select
Selection.End(x1Up).Select
Selection.Offset(1, -1).Select
' PEGAR DATOS ASIENTOS
Selection.PasteSpecial Paste:=x1Values, Operation:=x1None, SkipBlanks:=False, Traspose:=False
' INICIO
Aplication.CutCopyMode = False
Range("b5").Select
' MENSAJE INDICANDO NUMERO DE ASIENTO
NRO_ASIENTO = Range("a5").Value
MsgBox ("Se ha contabilizado el asiento número" & NRO_ASIENTO)
' NUMERAR ASIENTO
Range("g5:h14,b5:d14").Select
Selection.ClearContents
Range("b5").Select
Else
MsgBox ("Existen errores en la carga del asiento, por favor verificar")
End If
End Sub

1 respuesta

Respuesta
1
Reitero la respuesta. Se agradece la atención de reparar la falta de saludo en la otra ;)
Tu rutina tiene varios errores de tipeo. Te las marco en negrita
Sub cargar_asiento()
Dim NRO_ASIENTO
' Consistencia de la carga
If Range("H18") = "Asiento Correcto" Then
' COPIANDO CARGA DE DATOS DE ASIENTO
Range("a5:h14").Select
Selection.Copy
' UBICARSE AL FINAL DE LA BASE DE ASIENTOS
Range("b5000").Select
Selection.End(xlUp).Select      'aparecía como x1Up
Selection.Offset(1, -1).Select
' PEGAR DATOS ASIENTOS
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False     'x1Values, x1None, Traspose
' INICIO
Application.CutCopyMode = False    'aparecía como Aplication
Range("b5").Select
' MENSAJE INDICANDO NUMERO DE ASIENTO
NRO_ASIENTO = Range("a5").Value
MsgBox ("Se ha contabilizado el asiento número" & NRO_ASIENTO)
' NUMERAR ASIENTO
Range("g5:h14,b5:d14").Select
Selection.ClearContents
Range("b5").Select
Else
MsgBox ("Existen errores en la carga del asiento, por favor verificar")
End If
End Sub
PD) En el futuro cuando tengas mensajes de error, indicanos la línea donde se para el depurador (la de amarillo)
Saludos Elsa, muchas gracias por la ayuda, soy inexperto en macros pero poco a poco voy aprendiendo espero no ser tedioso con mis consultas, si en dado caso lo soy asme lo ver, espero no te moleste que te tutee, ante todo el respeto muchas, pero muchas gracias. Joshua

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas