Como copiar fila en otro libro antes de eliminarla
publicado
Sub eliminarProducto()
Dim Dato As String
Dim C As Range
Dim uf As Long
uf = Hoja10.Range("A" & Rows.Count).End(xlUp).Row
With ListBox1
For x = 0 To .ListCount - 1
If .Selected(x) Then
Dato = ListBox1.Text
With Hoja10.Range("A2:A" & uf)
Set C = .Find(Dato, LookIn:=xlValues, lookat:=xlWhole)
If Not C Is Nothing Then
C.Rows.EntireRow.Copy
C.Rows.EntireRow.Delete
UserForm_Initialize
MsgBox "Ha eliminado la clave " & Dato
Exit Sub
End If
End With
End If
Next
End With
End Sub
Featured Replies
Archivado
Este tema está ahora archivado y está cerrado a más respuestas.
Sub eliminarProducto() Dim Dato As String Dim C As Range Dim uf As Long uf = Hoja10.Range("A" & Rows.Count).End(xlUp).Row With ListBox1 For x = 0 To .ListCount - 1 If .Selected(x) Then Dato = ListBox1.Text With Hoja10.Range("A2:A" & uf) Set C = .Find(Dato, LookIn:=xlValues, lookat:=xlWhole) If Not C Is Nothing Then C.Rows.EntireRow.Copy C.Rows.EntireRow.Delete UserForm_Initialize MsgBox "Ha eliminado la clave " & Dato Exit Sub End If End With End If Next End With End Sub