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.

Seleccinar varia hojas a partir array definida previamente

publicado

Hola a todos,

actualmente tengo una pequeña macro que oculta o me muestra hojas en fuunción de un valor, pero debido a que cada vez hay mas hojas la macro tarda bastante tiempo. Por lo que me gustaria intentar accelerar la ejecución. Actualmente uso un For para recorrer todas las hojas que hay que modificar (anexo codigo fuente) y creo que si pudiese seleccionar todas las hojas de golpe en lugar de ir una a una reduciria el tiempo de ejecucion de la macro bastante.

Dim DEPTO(42) As Variant

DEPTO(0) = "G. VARIABLES"

DEPTO(1) = "G. VENTA"

DEPTO(2) = "G. PRODUCTO"

DEPTO(3) = "G. PERSONAL"

...

DEPTO(42) = "G. INMUEBLES"

'MOSTRAR LA COLUMNA DEL MES EN LAS PESTAÑAS A REPORTAR

X = 0

For X = LBound(DEPTO) To UBound(DEPTO)

Sheets(DEPTO(X)).Select

Sheets(DEPTO(X)).Columns("D:O").Select

Selection.EntireColumn.Hidden = False

Sheets(DEPTO(X)).Range("E:E,F:F,G:G,H:H,I:I,J:J,K:K,L:L,M:M,N:N,O:O").Select

Selection.EntireColumn.Hidden = True

Next X

La idea seria hacer algo como:

Sheets(DEPTO()).Select

Sheets(DEPTO()).Columns("D:O").Select

Selection.EntireColumn.Hidden = False

Sheets(DEPTO()).Range("E:E,F:F,G:G,H:H,I:I,J:J,K:K,L:L,M:M,N:N,O:O").Select

Selection.EntireColumn.Hidden = True

Pero no consigo hacer que funcione...

Gracias de antemano

Featured Replies

No hay posts para mostrar

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.