hi i try to do with a command button and textbox find and find next
also a solution for the other textboxes will show the value of cells of that finded word in row
but still not working
this is what i have now
Workbooks("L_PR_02 D_Receptieboek.xlsx").Sheets("2016").Activate
Dim FoundCell As Range, LastCell As Range
Dim tezoekenwaarde As String, firstaddress As String
tezoekenwaarde = Me.TextBox23.Value
With Sheets("2016").Range("A:l")
Set LastCell = .Cells(.Cells(.Rows.Count, "A").End(xlUp).Row, 1)
Set FoundCell = .Range("A:l").Find(what:=tezoekenwaarde, after:=LastCell, _
LookAt:=xlWhole, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False)
If Not FoundCell Is Nothing Then
firstaddress = FoundCell.Address
Do
Debug.Print FoundCell.Address
Set FoundCell = .Range("A:l").FindNext(after:=FoundCell)
Loop While Not FoundCell Is Nothing And FoundCell.Address <> firstaddress
Else
MsgBox tezoekenwaarde & Chr(10) & "Record Not Found", 48, "Not Found"
End If
If TextBox22.Value = True Then TextBox13.Value = Range("b" & TextBox22.Value).Value
If TextBox22.Value = True Then TextBox14.Value = Range("c" & TextBox22.Value).Value
If TextBox22.Value = True Then TextBox15.Value = Range("d" & TextBox22.Value).Value
If TextBox22.Value = True Then TextBox16.Value = Range("e" & TextBox22.Value).Value
If TextBox22.Value = True Then TextBox17.Value = Range("f" & TextBox22.Value).Value
If TextBox22.Value = True Then TextBox18.Value = Range("g" & TextBox22.Value).Value
If TextBox22.Value = True Then TextBox19.Value = Range("h" & TextBox22.Value).Value
If TextBox22.Value = True Then TextBox20.Value = Range("i" & TextBox22.Value).Value
If TextBox22.Value = True Then TextBox21.Value = Range("j" & TextBox22.Value).Value
End If
End With
End Sub
i want to add also a c.row value
Set c.Row = TextBox22.Value
If Not foundcell Is Nothing Then
TextBox22.Value = c.Row
so if the find is founded
my other textboxes wil fill value of that row
like this
If TextBox22.Value = True Then TextBox13.Value = Range("b" & TextBox22.Value).Value
If TextBox22.Value = True Then TextBox14.Value = Range("c" & TextBox22.Value).Value
If TextBox22.Value = True Then TextBox15.Value = Range("d" & TextBox22.Value).Value
If TextBox22.Value = True Then TextBox16.Value = Range("e" & TextBox22.Value).Value
If TextBox22.Value = True Then TextBox17.Value = Range("f" & TextBox22.Value).Value
If TextBox22.Value = True Then TextBox18.Value = Range("g" & TextBox22.Value).Value
If TextBox22.Value = True Then TextBox19.Value = Range("h" & TextBox22.Value).Value
If TextBox22.Value = True Then TextBox20.Value = Range("i" & TextBox22.Value).Value
If TextBox22.Value = True Then TextBox21.Value = Range("j" & TextBox22.Value).Value
hope there is a solution for this
Bookmarks