Gruppe
Ereignis
Problem
Bei Doppelklick in eine Zelle in den Spalten A:B soll sich eine InputBox zur Eingabe einer Artikelnummer öffnen. Diese Artikelnummer soll in Spalte A gesucht und die Zelle neben der Fundstelle soll ausgewählt werden
ClassModule: Tabelle1
Private Sub Worksheet_BeforeDoubleClick( _
ByVal Target As Range, Cancel As Boolean)
Dim var As Variant
Dim sTxt As String
If Target.Column > 2 Then Exit Sub
Cancel = True
sTxt = InputBox("Artikelnummer:", , "234")
If sTxt = "" Then Exit Sub
sTxt = "*" & sTxt & "*"
var = Application.Match(sTxt, Columns(1), 0)
If Not IsError(var) Then
Cells(var, 2).Select
End If
sTxt = InputBox("Eingabe:", , "Ein Text")
If sTxt = "" Then Exit Sub
Cells(var, 2) = sTxt
Call Worksheet_BeforeDoubleClick(ActiveCell, False)
End Sub