Private Sub Worksheet_Change(ByVal Target As Range) Dim Data() As Variant, I As Long If Target.Address = "$A$1" Then Data = Range("B1:B" & Range("B65536").End(xlUp).Row) For I = 1 To UBound(Data) If Data(I, 1) = Target.Value Then Range("B" & I).Select Exit Sub End If Next Target = "Ikke fundet" End If End Sub
Private Sub Worksheet_Change(ByVal Target As Range) Dim Data() As Variant, I As Long If Target.Address = "$A$1" Then Data = Range("B1:B" & Range("B65536").End(xlUp).Row) For I = 1 To UBound(Data) If Data(I, 1) = Target.Value Then Range("B" & I).Select Exit Sub End If Next Application.EnableEvents = False Target = "Ikke fundet" Application.EnableEvents = True End If End Sub
Det skulle være ordnet nu.
Du skriver: 'Jeg har ændret så den kun søger til og med række 30.000'
Den finder selv ud af hvor mange rækker du har i kolonne B, så du behøver ikke at rette.
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.