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 al filtrar con macros

publicado

Hola a todos:

Después de intentar e intentar, no consigo hacer Filtrar con las condiciones que necesito.

Resulta que en una variable de tipo string, almaceno los valores para que se filtren.

Cuando inserto los valores de forma manual, lo hace correctamente. Pero cuando le paso los valores que tengo en la variable, no consigo que funcione el filtro. Aparece como si no filtrase nada.

No se que es lo que estoy haciendo mal.

¿Me podéis ayudar?

ejemplo.xlsm

Featured Replies

publicado

Te dejo 2 soluciones:

1).

Private Sub CommandButton1_Click()
   Dim Números As Variant
   Números = Array("1", "3", "5", "7")
   ActiveSheet.Range("$B$4:$C$13").AutoFilter Field:=1, Criteria1:=Números, Operator:=xlFilterValues
End Sub

2).

Private Sub CommandButton1_Click()
   ActiveSheet.Range("$B$4:$C$13").AutoFilter Field:=1, _
      Criteria1:=Array("1", "3", "5", "7"), Operator:=xlFilterValues
End Sub

 

publicado
  • Autor

Hola Antoni:

La primera opción me ha servido y he podido solucionar mi problema.

 

Muy agradecido

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.