Como Copiar datos ListBox a Excel
Quiero copiar las filas de un ListBox a Excel conservando el siguiente orden.
If Me.ListBox1.ListCount = 0 Then MsgBox "NO HAY VALORES PARA INGRESAR. ", vbExclamation, "ADesing. Entradas": Exit Sub
Set Rango = Sheets("Entradas").Range("A1").CurrentRegion
NuevaFila = Rango.Rows.Count + 1
UltimoID = Sheets("Entradas").Range("L1").Value + 1
With Sheets("Entradas")
.Cells(NuevaFila, 1).Value = Date 'FECHA
.Cells(NuevaFila, 2).Value = UltimoID 'ID_MOVIMIENTO
. Cells(NuevaFila, 3).Value = Me. ListBox1. List(Me. ListBox1. ListCount - 1, 0) 'CÓDIGO
. Cells(NuevaFila, 4).Value = Me. ListBox1. List(Me. ListBox1. ListCount - 1, 1) 'DESCRIPCIÓN
. Cells(NuevaFila, 5).Value = Me. ListBox1. List(Me. ListBox1. ListCount - 1, 2) 'Color
. Cells(NuevaFila, 6).Value = Me. ListBox1. List(Me. ListBox1. ListCount - 1, 3) 'Terminado
. Cells(NuevaFila, 7).Value = Me. ListBox1. List(Me. ListBox1. ListCount - 1, 4) 'linea
. Cells(NuevaFila, 8).Value = Me. ListBox1. List(Me. ListBox1. ListCount - 1, 5) 'cojinera
. Cells(NuevaFila, 9).Value = Me. ListBox1. List(Me. ListBox1. ListCount - 1, 7) 'comentarios
.Cells(NuevaFila, 10).Value = Me.ListBox1.List(Me.ListBox1.ListCount - 1, 6) 'Qty_salida
.Cells(NuevaFila, 11).Value = Me.txtUser 'usuario
End With