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.

Borrar toda la fila si no encontró el valor en el VLOOKUP

publicado

Qué tal, estoy teniendo problemas intentando eliminar la fila completa si no encuentra el valor en el vlookup, intenté filtrando y eliminando después del vlookup, en la condición del vlookup intenté la función .entireRow.Delete y aunque no me marca error, nunca termina de ejecutar la macro completa.

¿ Cómo puedo eliminar la fila completa del valor que no encuentre en el VLOOKUP ?

'VLOOKUP
   Dim Celda As Range, z As Long
    Application.ScreenUpdating = False
    Range("L:L").Clear
    For z = 2 To Range("B" & Rows.Count).End(xlUp).Row
        Set Celda = Sheets("Copia").Range("A:A").Find(Range("B" & z), , , xlWhole)
        If Not Celda Is Nothing Then
            Range("L" & z) = Celda.Offset(0, 6)
        Else
            Range("L" & z) = ""
            'Range("L" & z).Interior.Color = vbGreen
        End If
    Next
    
    'Filter and delete
    Dim RowToTest2 As Long

    For RowToTest2 = Cells(Rows.Count, 12).End(xlUp).Row To 3 Step -1

    With Cells(RowToTest2, 12)
    If .Value <> "Mexico Co CARS" _
    And .Value <> "Mexico Otras" _
    And .Value <> "Mexico P&S" _
    And .Value <> "Mexico S&M" _
    Then _
    Rows(RowToTest2).EntireRow.Delete
    End With

    Next RowToTest2

 

Featured Replies

publicado

Sin ver el archivo y sin explicar que quieres hacer va a ser imposible.

publicado
Sub EliminarFilas()
Application.ScreenUpdating = False
For x = Range("A" & Rows.Count).End(xlUp).Row To 2 Step -1
   If Range("L" & x) = "" Then Rows(x).Delete
Next
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.