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.

Bloquear rangos de celdas

publicado

Buenas, es mi primer mensaje así que espero expresarme bien y que se me entienda.

El problema es el siguiente:

Tengo una plantilla excel en el servidor, cuando un usuario se conecta desde un php, copio la plantilla, relleno sus datos y se descarga.

Ahora me interesaría que unos rangos de celdas estén bloqueados, así que he estado buscando en temas relacionados y he probado varias formas pero no consigo hacerlo.

La macro para hacer esto la he puesto en la hoja correspondiente y el código es el siguiente:

Private Sub worksheet_activate()
ActiveSheet.Unprotect
Dim UltCol As Integer
Dim UltFil As Integer
UltCol = Cells(3, Cells.Columns.Count).End(xlToLeft).Column
UltFil = Range("A" & Rows.Count).End(xlUp).Row
letraCol = Letra_Columna(UltCol)
Range("A1:" & letraCol & "3").Locked = True
Range("A4:F" & UltFil).Locked = True
Range("A" & UltFil & ":" & letraCol & UltFil).Locked = True
ActiveSheet.Protect
End Sub
Function Letra_Columna(ByVal lCol As Long) As String
Letra_Columna = Replace$(Cells(1, lCol).Address(False, False), "1", "")
End Function[/CODE]

No he adjuntado la plantilla porque contiene datos confidenciales, pero si es necesario intentare eliminarlos y subirlo.

Un saludo y 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.