Macro que se ejecute cuando cambia el valor en una celda de otra hoja
"para Dante Amor"
Mi archivo tiene varias hojas las de mi interés son :
Hoja3 (Datos)
Hoja4 (Diagrama)
Necesito que la siguiente macro se ejecute cuando en la hoja Datos se cambie el valor de la celda “D13” la macro se encuentra en la hoja Diagrama. La macro se ejecuta perfecto mientras la celda se encuentre en la misma hoja (Diagrama)
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$19" Then
If Range("A19").Value = "Fisicoquímica" Then
ActiveSheet.Shapes("6 Conector recto").Visible = True
ActiveSheet.Shapes("8 Conector recto").Visible = True
ActiveSheet.Shapes("11 Conector recto").Visible = True
ActiveSheet.Shapes("19 Conector recto").Visible = True
ActiveSheet.Shapes("24 Conector recto").Visible = True
ActiveSheet.Shapes("31 Conector recto").Visible = True
ActiveSheet.Shapes("33 Conector recto").Visible = True
ActiveSheet.Shapes("34 Conector recto").Visible = True
ActiveSheet.Shapes("35 Conector recto").Visible = True
ActiveSheet.Shapes("36 Conector recto").Visible = True
ActiveSheet.Shapes("37 Conector recto").Visible = True
ActiveSheet.Shapes("40 Conector recto").Visible = True
ActiveSheet.Shapes("46 Conector recto").Visible = True
ActiveSheet.Shapes("48 Conector recto").Visible = True
ActiveSheet.Shapes("17 Conector recto").Visible = False
ActiveSheet.Shapes("21 Conector recto").Visible = False
ElseIf Range("A19").Value = "Física" Then
ActiveSheet.Shapes("6 Conector recto").Visible = False
ActiveSheet.Shapes("8 Conector recto").Visible = False
ActiveSheet.Shapes("11 Conector recto").Visible = False
ActiveSheet.Shapes("19 Conector recto").Visible = False
ActiveSheet.Shapes("24 Conector recto").Visible = False
ActiveSheet.Shapes("31 Conector recto").Visible = False
ActiveSheet.Shapes("33 Conector recto").Visible = False
ActiveSheet.Shapes("34 Conector recto").Visible = False
ActiveSheet.Shapes("35 Conector recto").Visible = False
ActiveSheet.Shapes("36 Conector recto").Visible = False
ActiveSheet.Shapes("37 Conector recto").Visible = False
ActiveSheet.Shapes("40 Conector recto").Visible = False
ActiveSheet.Shapes("46 Conector recto").Visible = False
ActiveSheet.Shapes("48 Conector recto").Visible = False
ActiveSheet.Shapes("17 Conector recto").Visible = True
ActiveSheet.Shapes("21 Conector recto").Visible = True
Else
ActiveSheet.Shapes("6 Conector recto").Visible = True
ActiveSheet.Shapes("8 Conector recto").Visible = True
ActiveSheet.Shapes("11 Conector recto").Visible = True
ActiveSheet.Shapes("19 Conector recto").Visible = True
ActiveSheet.Shapes("24 Conector recto").Visible = True
ActiveSheet.Shapes("31 Conector recto").Visible = True
ActiveSheet.Shapes("33 Conector recto").Visible = True
ActiveSheet.Shapes("34 Conector recto").Visible = True
ActiveSheet.Shapes("35 Conector recto").Visible = True
ActiveSheet.Shapes("36 Conector recto").Visible = True
ActiveSheet.Shapes("37 Conector recto").Visible = True
ActiveSheet.Shapes("40 Conector recto").Visible = True
ActiveSheet.Shapes("46 Conector recto").Visible = True
ActiveSheet.Shapes("48 Conector recto").Visible = True
ActiveSheet.Shapes("17 Conector recto").Visible = True
ActiveSheet.Shapes("21 Conector recto").Visible = True
End If
End If
End Sub