Copiar formatos y formulas según la cantidad de veces pedida
buenas estoy haciendo un proyecto en el cual se trata de introducir modificar y eliminar registro
la cuestión que quiero hacer es la siguiente: ya introduje todos los datos que necesito al formulario me lanza el resumen del cual el botón se encargra de introducirlos tanvas veces se pidió en la BASE DE DATOS paso el código del botón :
Private Sub BtnGrabarDatos_Click()
On Error Resume Next
intvalor = 1
For i = 1 To ReCantidad Step 1
Range("B6").Select
Do While Not IsEmpty(ActiveCell)
ActiveCell.Offset(1, 0).Select
Loop
Range("B5:V5").Copy
Selection.PasteSpecial Paste:=xlPasteFormulasAndNumberFormats,
Paste:=xlPasteFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
ActiveCell = CDbl(ReCodigo)
ActiveCell.Offset(0, 1) = ReCategoria
If IsNumeric(ReNuFactura) Then
ActiveCell.Offset(0, 2) = CDbl(ReNuFactura)
Else
ActiveCell.Offset(0, 2) = ReNuFactura
End If
If ReReferencia.Enabled = False Then
ActiveCell.Offset(0, 5) = ""
ElseIf IsNumeric(ReReferencia) Then
ActiveCell.Offset(0, 5) = CDbl(ReReferencia)
Else
ActiveCell.Offset(0, 5) = ReReferencia
End If
ActiveCell.Offset(0, 6) = ReDescripcion
ActiveCell.Offset(0, 7) = ReFecha
ActiveCell.Offset(0, 10) = ReEstado
If ReVaUnitario1.Enabled = True Then
ActiveCell.Offset(0, 11) = CDbl(ReVaUnitario1)
Else
ActiveCell.Offset(0, 11) = CDbl(ReVaUnitario2)
End If
Next i
VCantidad1 = ""
VCantidad2 = ""
VUnitario1 = ""
VUnitario2 = ""
VTotal1 = ""
VTotal2 = ""
Unload Me
End Sub
el problema que tengo es que a pesar de que me copia la fila de formato no me la inserta ni siquiera una vez que estoy haciendo mal?