Saltar al contenido
View in the app

A better way to browse. Learn more.

Ayuda Excel

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

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

publicado
  • Autor

Disculpa amigos por la prisa no puse lo requerido.

Requiero adaptar esta macro para que antes de eliminar la fila seleccionada del Listbox y de la hoja10  la copie en otro libro llamado "Resguardo entregado" en la ultima fila vacia de la hoja1, anexando una columna mas con fecha y hora del copiado. espero apoyo de los especialista. gracias por su atencion

publicado
  • Autor
Hace 48 minutos , jose lopez contreras dijo:

 


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.Delete
                        UserForm_Initialize
                        MsgBox "Ha eliminado la clave  " & Dato
                        Exit Sub
                     End If
                  End With
          End If
       Next
    End With

End Sub

 

 

Archivado

Este tema está ahora archivado y está cerrado a más respuestas.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.