Duplicar filas según valor de celda-VBA

Para Dante Amor,

Actualmente tengo la siguiente macro que duplica las filas correctamente, pero siempre y cuando se tenga como mínimo 2 valores ingresados a partir de la fila 8, si solo ingreso un valor en la fila 8 no me duplica el valor y me sale un mensaje de error.

"Se ha producido el error 1004" en tiempo de ejecución

No puede pegar esto aqui porque el área de copiar y el área de pegado no tienen el mismo tamaño

Seleccione solo una celda en el area de pegado o un área que tenga el mismo tamaño e intente pegar de nuevo

Espero pueda contar con tu apoyo y agradezco de antemano su gentil asistencia como profesional experto.

Sub Duplica()
Application.ScreenUpdating = False
Dim REPETIR As Integer
REPETIR = Range("O3")
Range("B8").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
For Q = 1 To REPETIR
Range("B50007").End(xlUp).Offset(1, 0).Select
ActiveSheet.Paste
Next Q
Application.CutCopyMode = False
Range("B8").Select
Range("G8").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
For Q = 1 To REPETIR
Range("G50007").End(xlUp).Offset(1, 0).Select
ActiveSheet.Paste
Next Q
Application.CutCopyMode = False
Range("G8").Select
Range("A8").Activate
Application.ScreenUpdating = True
Application.ScreenUpdating = False
Application.ScreenUpdating = True
Application.StatusBar = "Ejecución terminada."
End Sub

Añade tu respuesta

Haz clic para o