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 1004 quite la protección de la celda! awww !

publicado

Buenas amigos genios del excel!, me podrían ayudar con este problema que se genera cuando:

1.- tengo una hoja llamada Generar CI = Código Interno

2.- Hoja de Propuestas donde se almacenan los CI

De todas maneras adjunto el archivo :( para q me ayuden!

Gracias de antemano! >_<

Lo siguiente es que debo proteger la Hoja Propuestas y de la hoja de CI podré modificar sólo el nombre que ingresare el requerimiento. Al proteger me sale error!, la macro que utilizé para generar el CI y es donde me marca en amarillo es el siguiente:

Sub btn_procesar()

Dim rbase, cbase As Integer

Dim cant As Integer

Dim desc, cod, cli, jp As String

Dim msg As Variant

Sheets("Formulario").Select

desc = Range("B7").Value

cod = Range("H4").Value

cli = Sheets("Datos").Range("C" & (ic + 1)).Value

jp = Sheets("Jefes").Range("B" & (ij + 1)).Value

Range("B11").Select

If desc = 0 Then

ActiveCell.Value = "DATOS VACIOS!!!"

Else

ActiveCell.Value = ""

Sheets("Propuestas").Select

cant = Range("D1").Value

rbase = 3 + cant

Range("B" & rbase).Value = desc <-marca en amarrillo

Range("C" & rbase).Value = cod

Range("A" & rbase).Value = cli

Range("D" & rbase).Value = jp

Range("E" & rbase).Value = DateValue(Now)

cant = cant + 1

Range("D1").Value = cant

Sheets("Datos").Cells(ic + 1, ij + 3).Value = Sheets("Datos").Cells(ic + 1, ij + 3).Value + 1

Sheets("Formulario").Select

Range("B7").Value = ""

msg = generarCodigo()

End If

End Sub

Y esta es la macro para generar el código interno:

Function generarCodigo()

Dim msj As Variant

Dim indexc, indexj As Integer

Dim y As String

ic = Sheets("Datos").Range("A1").Value

ij = Sheets("Datos").Range("B1").Value

Dim val1, val2, val3, val4 As String

val4 = Sheets("Datos").Range("C1").Value

val1 = Sheets("Datos").Range("C" & (ic + 1)).Text

val3 = Format(Sheets("Datos").Cells(ic + 1, ij + 3).Value + 1, "000")

val2 = Sheets("Datos").Range("B1").Value

Sheets("Formulario").Range("H4").Value = val1 & "-" & val4 & "-" & val2 & val3

End Function

Generar_CI_pruebaaa.zip

Featured Replies

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.