Új hozzászólás Aktív témák

  • bsh

    őstag

    válasz kispéé #29017 üzenetére

    másik verzió:
    (feltételezi, hogy egy workbookban van a két táblázat: Munka1 és Munka2)

    Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
    Select Case Target.Worksheet.Name
    Case "Munka1"
    If Target.Column = 1 Then
    On Error Resume Next
    If Not Worksheets.Item("Munka2") Is Nothing Then
    On Error GoTo 0
    With Worksheets.Item("Munka2")
    Set X = .Range("G:G").Find(Target.Value, lookat:=xlWhole)
    If Not X Is Nothing Then
    Application.EnableEvents = False
    Application.Goto .Cells(X.Row, X.Column)
    Application.EnableEvents = True
    End If
    End With
    End If
    On Error GoTo 0
    End If
    Case "Munka2"
    If Target.Column = 7 Then
    On Error Resume Next
    If Not Worksheets.Item("Munka1") Is Nothing Then
    On Error GoTo 0
    With Worksheets.Item("Munka1")
    Set X = .Range("A:A").Find(Target.Value, lookat:=xlWhole)
    If Not X Is Nothing Then
    Application.EnableEvents = False
    Application.Goto .Cells(X.Row, X.Column)
    Application.EnableEvents = True
    End If
    End With
    End If
    On Error GoTo 0
    End If
    End Select
    End Sub

Új hozzászólás Aktív témák