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.

Operar con ficheros y hojas protegidos

publicado

Estoy tratando de crear una macro sencilla que opere dentro de un libro que está protegido y que opere con hojas protegidas. La respuesta que obtengo es "error 1004". Si desprotejo el libro y las hojas, funciona sin problemas. ¿Hay alguna posibilidad de que trabaje de la forma que pretendo? Gracias.

Featured Replies

publicado

Claro que si.

Adjunta un ejemplo, segun las normas del foro , para poder ayudarte

publicado
  • Autor

Sub ACTUALIZACIÓNDEDATOS()

'

' ACTUALIZACIÓNDEDATOS Macro

' Actualiza todas las pivot tables y genera todos los cuadros y gráficos de información volviendo al estado primitivo de protección de hojas y fichero.

'

'

ActiveWorkbook.Unprotect

Sheets("INSTRUCCIONES").Select

Sheets("PIVOT TABLE").Visible = True

ActiveWindow.LargeScroll ToRight:=-2

Range("A7").Select

ActiveSheet.PivotTables("Tabla dinámica2").PivotCache.Refresh

Range("E7").Select

ActiveSheet.PivotTables("Tabla dinámica3").PivotCache.Refresh

Range("J7").Select

ActiveSheet.PivotTables("Tabla dinámica1").PivotCache.Refresh

ActiveWindow.SmallScroll ToRight:=6

Range("N7").Select

ActiveSheet.PivotTables("Tabla dinámica4").PivotCache.Refresh

ActiveWindow.SmallScroll ToRight:=6

Range("R3").Select

ActiveSheet.PivotTables("Tabla dinámica5").PivotCache.Refresh

Range("U3").Select

ActiveSheet.PivotTables("Tabla dinámica6").PivotCache.Refresh

Sheets("PIVOT TABLE").Select

ActiveWindow.SelectedSheets.Visible = False

ActiveWorkbook.Protect Structure:=True, Windows:=False

End Sub

publicado

@adiaz1959

[note]Las fórmulas o códigos es necesario envolverlos con etiquetas tal y como se indica en las Normas del Foro en su punto 2.19, más detalles en el siguiente enlace.

Envolver fórmulas y códigos con etiquetas en los mensajes[/note]

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.