Fill textbox with cell value based om id : <p>I need the corresponding invoice id to be on the invoice frame called frmTrade and the rest of the data in the other textboxes..</p>

<p>I am by no means an expert so any help is appreciated. I only succeeded in coloring the relevant id's red.</p>

<p>No error messages, but it is not choosing the relevant id double clicking on the lstInvoiceView listbox.</p>

<pre><code>Private Sub lstInvoiceView_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
    WatchInvoiceSheetId
End Sub

Sub WatchInvoiceSheetId()
    On Error Resume Next

    Worksheets("Faktura").Activate
    Dim ws As Worksheet
    Dim numRow As Integer
    Dim found As Boolean
    Set ws = ThisWorkbook.Worksheets("Faktura")
    strRows = ws.Range("E" &amp; ws.Rows.Count).End(xlUp).row
    Worksheets("Faktura").Range("A2:A" &amp; strRows).Interior.ColorIndex = 0

    If frmCostumer.lstInvoiceView.ListCount &lt;&gt; 0 Then
        frmCostumer.lstInvoiceView.Clear
    End If

    i = 0

    For numRow = 1 To strRows
If frmCostumer.txtCostumerId.Value = ws.Range("E" &amp; numRow).Text Then

        i = i + 1
    frmCostumer.txtQuantityInvoice.Value = i

    If Worksheets("Faktura").Range("A" &amp; numRow &amp; ":A" &amp; numRow).Interior.ColorIndex = 3 Then
        Worksheets("Faktura").Range("A" &amp; numRow &amp; ":A" &amp; numRow).Interior.ColorIndex = 3
        ElseIf Worksheets("Faktura").Range("A" &amp; numRow &amp; ":A" &amp; numRow).Interior.ColorIndex = 1 Then
        Exit Sub
    Else
        Worksheets("Faktura").Range("A" &amp; numRow &amp; ":A" &amp; numRow).Interior.ColorIndex = 3

        With frmTrade.txtInvoicNumber
            .Value = Worksheets("Faktura").Range("A" &amp; numRow - 
              frmCostumer.lstInvoiceView.ListCount - numRow &amp; ":A" &amp; numRow - frmCostumer.lstInvoiceView.ListCount - numRow).Value
        End With
        DoEvents
        frmCostumer.Hide
        frmTrade.Show
    End If

    found = True
    'Exit For

End If
Next numRow

If found = False Then
        frmCostumer.txtQuantityInvoice.Value = i
        frmTrade.txtInvoicNumber.Value = "Findes ikke!"
End If
End Sub
</code></pre>
