Private Sub Worksheet_BeforeDoubleClick(ByVal R As Range, Cancel As Boolean)
Set v = Feuil1.Cells.Find(R.Text, Feuil1.Cells(1, 1))
On Error Resume Next
Application.Goto Feuil1.Range(v.Address)
End Sub
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Target.Row < 7 Or Target.Column <> 7 Then Exit Sub
Dim c As Range
Cancel = True
With Sheets("Feuil1") 'nom à adapter
.Visible = xlSheetVisible 'si la feuille est masquée
If .FilterMode Then .ShowAllData 'si la feuille est filtrée
With .Range("A1", .UsedRange)
With .Columns(.Columns.Count + 1) 'colonne auxiliaire
.Formula = "=D1&E1" 'concaténation
Set c = .Find(Target & Target(1, 2), , xlValues, xlWhole)
.ClearContents 'RAZ
If c Is Nothing Then
MsgBox "Pas de correspondance en Feuil1..."
Else
Application.Goto .Parent.Cells(c.Row, "D")
End If
End With
End With
End With
End Sub
Doucement avec l'autoflagellation ...Kael_88
La mienne de proposition excelle surtout dans sa rustique incomplétude
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Target.Row < 7 Or Target.Column <> 7 Or Target = "" Then Exit Sub
Dim c As Range, adr$
Cancel = True
With Sheets("Feuil1") 'nom à adapter
.Visible = xlSheetVisible 'si la feuille est masquée
If .FilterMode Then .ShowAllData 'si la feuille est filtrée
Set c = .Cells(.Rows.Count, .Columns.Count)
Do
Set c = .Cells.Find(Target, c, xlValues, xlWhole)
If c Is Nothing Then
Exit Do
Else
If adr = "" Then adr = c.Address Else If c.Address = adr Then Exit Do
If c & c(1, 2) = Target & Target(1, 2) Then Application.Goto c: Exit Do
End If
Loop
End With
If ActiveSheet.Name = Me.Name Then MsgBox "Pas de correspondance en Feuil1..."
End Sub
@mapommeEn même temps, la demande de Kael_88 n'était pas des plus précises. Et sa réponse est tout autant ambigüe mais a l"avantage de ménager la chèvre, le chou et le loup (chacun de Staple1600, job75 et mapomme se reconnaitra)
J'ai vu celle-ci. L'agneau peut bien remplacer la chèvre.il faut cliquer sur le lien ci-dessus pour comprendre
Ah oui un va-et-vient, alors dans ThisWorkbook :le pourquoi du va-et-vient entre ces deux feuilles
Private Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)
If Target(1) = "" Then Exit Sub
Dim a, n As Variant, c As Range, adr$
a = Array("Feuil1", "Feuil2") 'noms des feuilles à adapter
n = Application.Match(Sh.Name, a, 0)
If IsError(n) Then Exit Sub
Cancel = True
With Sheets(a(2 - n))
.Visible = xlSheetVisible 'si la feuille est masquée
If .FilterMode Then .ShowAllData 'si la feuille est filtrée
Set c = .Cells(.Rows.Count, .Columns.Count)
Do
Set c = .Cells.Find(Target, c, xlValues, xlWhole)
If c Is Nothing Then
Exit Do
Else
If adr = "" Then adr = c.Address Else If c.Address = adr Then Exit Do
If c & c(1, 2) & c(1, 3) = Target(1) & Target(1, 2) & Target(1, 3) Then Application.Goto c: Exit Do
End If
Loop
End With
If ActiveSheet.Name = Sh.Name Then MsgBox "Pas de correspondance en " & a(2 - n)
End Sub