Famille de feuilles de calcul Microsoft avec des outils pour l’analyse, le graphique et la communication des données.
Ta colonne lien dans DATA ne fait pas mieux que mon code pour le chemin d'accès : "&[@FILIERE]&""&[@FILIERE]&".xlsm] 😁
Je te propose ça :
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim strChemin As String
Dim strFichier As String
Dim strLigne As String
Dim strColonne As String
Dim varNumColonne
Dim varNumLigne
On Error GoTo erreur
' Test clic dans le TCD
If Intersect(Target, Range("C2:G" & [C1].End(xlDown).Row)) Is Nothing Then
Exit Sub
End If
strFichier = Cells(Target.Row, 4).Value
strLigne = Cells(Target.Row, 6).Value
strColonne = Cells(Target.Row, 7)
' Test clic ligne avec statut et nom
If (strLigne = "") Or (strColonne = "") Then Exit Sub
' A MODIFIER <<<<<<<<<<<<<<<<<<<<<<<<<<
strChemin = ThisWorkbook.Path & "\" & strFichier & "\" & strFichier & ".xlsm"
Workbooks.Open strChemin
Worksheets("Statut").Activate
' Utilisation de ActiveSheet obligatoire même si feuille active
varNumColonne = Application.Match(strColonne, ActiveSheet.Rows(2), 0)
If IsError(varNumColonne) Then
MsgBox "Colonne " & strColonne & " non trouvée"
Exit Sub
End If
varNumLigne = Application.Match(strLigne, ActiveSheet.Columns(2), 0)
If IsError(varNumLigne) Then
MsgBox "Ligne " & strLigne & " non trouvée"
Exit Sub
End If
Application.Goto ActiveSheet.Cells(varNumLigne, varNumColonne)
Exit Sub
erreur:
MsgBox "Erreur " & Err.Number & "-" & Err.Description
End Sub
je vais me coucher !