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.

Error en Macro al Filtrar y borrar cierta condicion

publicado

Hola

Hice una macro que me filtra lo que contiene "ATO" en la columna H; si hay, se borran las filas el problema es que cuando bajo mi reporte y no hay "ATO" la macro me borra el titulo, es el mismo caso para la parte donde borra lo que contenga "DUMMY". Si alguien me puede ayudar a solucionar este error estare muy agradecido.

Adjunto una porcion del archivo para mejor referencia.

Sub MacroPrueba()

    strArchivo = Application.GetOpenFilename( _
        FileFilter:="Excel Files (*.xlsx), *.xlsx", _
        FilterIndex:=1, _
        Title:="Select: rptProductionCTO")
        If strArchivo = False Then Exit Sub
        Workbooks.OpenText Filename:=strArchivo
        Application.ScreenUpdating = False
        'Borrar ATO's y Dummy's: Aqui es donde tengo el error
        Columns("H:H").Select
        ActiveSheet.Range("$A$1:$AE$2000").AutoFilter Field:=8, Criteria1:="=*ATO*" _
        , Operator:=xlAnd
        finx = Range("A2000").End(xlUp).Row
        Rows("2:" & finx).Select
        Selection.Delete Shift:=xlUp
        Selection.AutoFilter
        Columns("H:H").Select
        ActiveSheet.Range("$A$1:$AE$2000").AutoFilter Field:=8, Criteria1:="=*DUMMY*" _
        , Operator:=xlAnd
        finx = Range("A2000").End(xlUp).Row
        Rows("2:" & finx).Select
        Selection.Delete Shift:=xlUp
        Selection.AutoFilter

 

Archivo de prueba.xlsx

Featured Replies

publicado
   If finx > 1 Then Rows("2:" & finx).Delete Shift:=xlUp

' en lugar de

  'Rows("2:" & finx).Select
  'Selection.Delete Shift:=xlUp

en lugar de

 

publicado
  • Autor

Muchas Gracias!
Es justo lo que necesitaba.

  • Silvia bloqueó este tema

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.