Una familia de software de hoja de cálculo de Microsoft con herramientas para analizar, trazar y comunicar datos.
Por alguna razón …
Dim Rango As String
Rango = ("TCotizacion[CosOrigen]")
If Not Application.Intersect(Range(Rango), Target) Is Nothing Then
Cancel = True
Sheets("Costos").Visible = True
Sheets("Costos").Select
ActiveSheet.Unprotect
Range("P1").Select
End If
End Sub
... no reconoce "Costos" como hoja activa, pues con...
Dim Rango As String
Rango = ("TCotizacion[CosOrigen]")
If Not Application.Intersect(Range(Rango), Target) Is Nothing Then
Cancel = True
Sheets("Costos").Visible = True
Sheets("Costos").Select
ActiveSheet.Unprotect
worksheets("Costos").Range("P1").Select
End If
End Sub
... no me salta el error.
Yo recomendaría:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim Rango As String
Rango = "TCotizacion[CosOrigen]"
If Not Application.Intersect(Range(Rango), Target) Is Nothing Then
Cancel = True
With Worksheets("Costos")
.Visible = True
.Activate
.Unprotect
.Range("P1").Select
End With
End If
End Sub