agregar datos copiados al principio de la lista de base de datos y que no guarde los datos en cero
publicado
hola buen dia. quisiera ayuda en este proyecto para guardar datos en rangos diferentes de celdas y que al guardar los coloque al inicio de la base datos y no al ultimo como lo hace ahora
esta es la macro
Sub GUARDAR_DATOS()
Dim NombreHoja As String
Dim HojaDestino As Range
Dim NuevaFila As Integer
Dim FilasFactura As Integer
Dim i As Integer
Dim j As Integer
Dim NumFactura As Integer
hola buen dia. quisiera ayuda en este proyecto para guardar datos en rangos diferentes de celdas y que al guardar los coloque al inicio de la base datos y no al ultimo como lo hace ahora
esta es la macro
Dim NombreHoja As String
Dim HojaDestino As Range
Dim NuevaFila As Integer
Dim FilasFactura As Integer
Dim i As Integer
Dim j As Integer
Dim NumFactura As Integer
NombreHoja = "VENTAS"
FilasFactura = Application.WorksheetFunction.CountA(Range("factura[CODIGO]"))
NumFactura = ThisWorkbook.Sheets("Factura").Range("c5").Value
With ThisWorkbook.Sheets(NombreHoja)
For i = 1 To FilasFactura
Set HojaDestino = ThisWorkbook.Sheets(NombreHoja).Range("a1").CurrentRegion
NuevaFila = HojaDestino.Rows.Count + 1
.Cells(NuevaFila, 1) = Range("c1").Value
.Cells(NuevaFila, 2) = Range("c2").Value
.Cells(NuevaFila, 3) = Range("c4").Value
For j = 1 To 8
.Cells(NuevaFila, j + 3).Value = ThisWorkbook.Sheets("Factura").Cells(8 + i, 1 + j)
Next j
Next i
End With
MsgBox "registro guardado"
End Sub