Featured Replies
Archivado
Este tema está ahora archivado y está cerrado a más respuestas.
A better way to browse. Learn more.
A full-screen app on your home screen with push notifications, badges and more.
Este tema está ahora archivado y está cerrado a más respuestas.
Buenas Noches
Tengo el siguiente código, que almacena las referencias de las celdas en la Variable Rango, para posteriormente borrar el contenido de las celdas.
El problema es que al llegar a la parte del borrado del Rango me Arroja error 1004 en tiempo de ejecución.
Son aproximadamente 100 celdas las que debe borrar.
Sub Factura_LimpiarPlantilla()
Dim Rango
Plantilla = "Factura_Registro"
Setup = "Factura_Setup"
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Sheets(Plantilla).Unprotect Clave
I = 2
Rango = ""
While Sheets(Setup).Cells(I, 3) <> ""
If Sheets(Setup).Cells(I, 5) = "SI" Then
Celda = Sheets(Setup).Cells(I, 3)
If Rango = "" Then Rango = Celda Else Rango = Rango & "," & Celda
End If
I = I + 1
Wend
Sheets(Plantilla).Range(Rango) = Empty
Sheets(Plantilla).Protect Clave
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub