Private Sub Worksheet_Change(ByVal Target As Range)
Dim B(50) As String
Dim j As Integer
Dim stadtk(50) As String
stadtk(1) = "QLB"
stadtk(2) = "HBS"
Dim stadtv(50) As String
stadtv(1) = "Quedlinburg"
stadtv(2) = "Halberstadt"
Dim i As Integer
For j = 12 To 20
For i = 1 To 2
If Range("B(j)").Value = stadtk(i) Then <----
Range("B(j)").Select <----
ActiveCell.FormulaR1C1 = stadtv(i)
End If
Next i
Next j
End SubPrivate Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Selection.Count < 2 Then
If Target.Column = 2 Then
Dim suche As Range
Set suche = Worksheets(2).Range("A2:A" & Worksheets(2).Range("A" & Rows.Count).End(xlUp).Row).Find(Workbooks(1).Worksheets(1).Cells(Target.Row, 2))
If Not suche Is Nothing Then
Worksheets(1).Cells(Target.Row, 2) = Worksheets(2).Cells(suche.Row, 2)
End If
End If
End If
Application.EnableEvents = True
End Sub Option Explicit Sub ArraySuche()
Dim ZeilenIndex As Long
Dim ArrQuelle As Variant
With Worksheets(2)
ArrQuelle = .Range("A2:B" & ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row)
End With
With Worksheets(1)
For ZeilenIndex = LBound(ArrQuelle, 1) To UBound(ArrQuelle, 1)
If ArrQuelle(ZeilenIndex, 1) = .Cells(1, 2) Then
.Cells(1, 2) = ArrQuelle(ZeilenIndex, 2)
Exit For
End If
Next ZeilenIndex
End With
End Sub
Excel Problem mit Zahlen
AM69 24.03.2009 - 132 Hits - 1 Antwort
Excel Wenn dann Problem
Lukyduke1 30.05.2009 - 188 Hits - 4 Antworten
Problem bei Excel Formel
Anubis01 10.06.2009 - 212 Hits - 6 Antworten
Excel Problem bei Überstundenberechnung
kuefra 23.07.2009 - 465 Hits - 18 Antworten
Excel: Problem mit Summe
Soeren 13.10.2009 - 396 Hits - 7 Antworten