Si doy a cancelar me da error la macro
Hola, Tengo hecha una macro con un inpubox que cuando doy a cancelar me da error 13 de ejecución y no se porque.
Me podría alguien ayudar, os adjunto la macro
Sub Macro_Nueva_Fila()
Dim Nro_Fila As Double
Dim Nro_copia As Double
'
Nro_Fila = InputBox("Ingrese el Número de la nueva Fila", "Nro_Fila")
'En la Hoja1
Nro_copia = Nro_Fila - 1
ActiveSheet.Unprotect Password:="daf"
Sheets("Cost_Plan").Select
Rows(Nro_Fila & ":" & Nro_Fila).Select
Selection.Insert Shift:=xlDown
Rows(Nro_copia & ":" & Nro_copia).Select
Selection.Copy
Rows(Nro_Fila & ":" & Nro_Fila).Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Rows(Nro_copia & ":" & Nro_copia).Select
Application.CutCopyMode = False
Selection.Copy
Rows(Nro_Fila & ":" & Nro_Fila).Select
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
ActiveSheet.Protect Password:="daf", DrawingObjects:=True, Contents:=True, Scenarios:=True
'Repite en la Hoja2
Sheets("cash_flow").Select
ActiveSheet.Unprotect Password:="daf"
Rows(Nro_Fila & ":" & Nro_Fila).Select
Selection.Insert Shift:=xlDown
Rows(Nro_copia & ":" & Nro_copia).Select
Selection.Copy
Rows(Nro_Fila & ":" & Nro_Fila).Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Rows(Nro_copia & ":" & Nro_copia).Select
Application.CutCopyMode = False
Selection.Copy
Rows(Nro_Fila & ":" & Nro_Fila).Select
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
ActiveSheet.Protect Password:="daf", DrawingObjects:=True, Contents:=True, Scenarios:=True
Sheets("Cost_Plan").Select
End Sub
Me podría alguien ayudar, os adjunto la macro
Sub Macro_Nueva_Fila()
Dim Nro_Fila As Double
Dim Nro_copia As Double
'
Nro_Fila = InputBox("Ingrese el Número de la nueva Fila", "Nro_Fila")
'En la Hoja1
Nro_copia = Nro_Fila - 1
ActiveSheet.Unprotect Password:="daf"
Sheets("Cost_Plan").Select
Rows(Nro_Fila & ":" & Nro_Fila).Select
Selection.Insert Shift:=xlDown
Rows(Nro_copia & ":" & Nro_copia).Select
Selection.Copy
Rows(Nro_Fila & ":" & Nro_Fila).Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Rows(Nro_copia & ":" & Nro_copia).Select
Application.CutCopyMode = False
Selection.Copy
Rows(Nro_Fila & ":" & Nro_Fila).Select
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
ActiveSheet.Protect Password:="daf", DrawingObjects:=True, Contents:=True, Scenarios:=True
'Repite en la Hoja2
Sheets("cash_flow").Select
ActiveSheet.Unprotect Password:="daf"
Rows(Nro_Fila & ":" & Nro_Fila).Select
Selection.Insert Shift:=xlDown
Rows(Nro_copia & ":" & Nro_copia).Select
Selection.Copy
Rows(Nro_Fila & ":" & Nro_Fila).Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Rows(Nro_copia & ":" & Nro_copia).Select
Application.CutCopyMode = False
Selection.Copy
Rows(Nro_Fila & ":" & Nro_Fila).Select
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
ActiveSheet.Protect Password:="daf", DrawingObjects:=True, Contents:=True, Scenarios:=True
Sheets("Cost_Plan").Select
End Sub
1 Respuesta
Respuesta de Elsa Matilde
1