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.

eliminar filas

publicado

Hola a todos,me interesaria una macro que me pudiera eliminar las filas que no coincidieran con una condicion en concreto esta seria el nombre.

Lo que me interesaria no seria el borrar los datos sino eliminar la fila

Gracias a todos por vuestro trabajo

eliminar nombre que no coincidan.xls

Featured Replies

publicado

Hola:

Aquí tienes una macro que hace lo que pides.

Sub EliminarNoPacosNoPepes()

Dim Rango As Range, Fila As Long, ÚltimaFila As Long

Application.ScreenUpdating = False

ÚltimaFila = ActiveSheet.UsedRange.Row + ActiveSheet.UsedRange.Rows.Count - 1
For Fila = ActiveSheet.UsedRange.Row To ÚltimaFila
Application.StatusBar = "Procesando fila " & Fila & " / " & ÚltimaFila
If (Range("E" & Fila).Value <> "paco" And _
Range("E" & Fila).Value <> "pepe") Then
If Rango Is Nothing = True Then
Set Rango = Rows(Fila)
Else
Set Rango = Application.Union(Rango, Rows(Fila))
End If
End If
Next Fila

If Rango Is Nothing = False Then
Rango.Select
Selection.Delete
ActiveCell.Select
End If

Application.StatusBar = "Listo"
Application.ScreenUpdating = True

End Sub


[/CODE]

Macro creada automáticamente con este aporte.

https://www.ayudaexcel.com/foro/ideas-aportes-64/macro-que-crea-macros-para-seleccionar-copiar-mover-eliminar-resaltar-ocultar-filas-25907/

publicado
  • Autor

La respuesta me ha funcionado de **** madre,no hay que decir que estoy empezando con esto de las macros,al intentar ejecutar la siguiente se me borra todo,como lo puedo solucionar

Daros de nuevo las gracias a todos

eliminar nombre que no coincidan 1.xls

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.