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.

Macro para eliminar filas con texto específico

publicado

Buenas tardes, tengo una planilla en donde voy trayendo datos de otras planillas (copio y pego) una vez que ya tengo toda la información, necesito que mediante una macro/formula se eliminen todas las filas en donde el primer dato (ubicado en la columna A) tiene el siguiente texto: QHP Standard 1,QHP Standard 2, QHP Standard 3, QHP Standard 4 y QHP Standard 5.

He aplicado la siguiente Macro, pero no se como unificar que evalúe las 5 variables, por lo que he tenido que hacer 5 macros, y después hacer una para unirlas a todas. Quisiera saber si existe la posibilidad de hacer solo una y que tome las 5 variables de texto posible

 

Sub Eliminar_Filas_1()

Sheets("Resultados exportados").Select
col = "A"
texto = "QHP Standard 1"

'
valor = texto
If IsNumeric(texto) Then valor = Val(texto)
If IsDate(texto) Then valor = CDate(texto)
'
Application.ScreenUpdating = False
For i = Range(col & Rows.Count).End(xlUp).Row To 1 Step -1
If LCase(Cells(i, "A")) = LCase(valor) Then
Rows(i).Delete
End If
Next
Application.ScreenUpdating = True
MsgBox "Filas eliminadas", vbInformation, "DAM"

End Sub

 

Desde ya muchas gracias

Featured Replies

publicado
Sub Eliminar_Filas_1()
Dim Filas As Integer
Application.ScreenUpdating = False
Sheets("Resultados exportados").Select
col = "A"
texto = Array( _
            "QHP Standard 1", _
            "QHP Standard 2", _
            "QHP Standard 3", _
            "QHP Standard 4", _
            "QHP Standard 5")
Application.ScreenUpdating = False
For i = Range(col & Rows.Count).End(xlUp).Row To 1 Step -1
   For t = 0 To UBound(texto)
      If LCase(Cells(i, col)) = LCase(texto(t)) Then
         Filas = Filas + 1
         Rows(i).Delete
         Exit For
      End If
   Next
Next
Application.ScreenUpdating = True
MsgBox Filas & " Filas eliminadas", vbInformation, "DAM"
End Sub

 

publicado

Muchas gracias Antoni

Me ayudó un montón!!!! Que tenga usted un excelente día

Saludos!

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.