(Solved) – Search column for value x and copy userform data to applicable row


I have got the below code I assigned k as the textbox value to check that it is working properly (seems it is) but it still refuses to search column A and simply executes the Else argument.

    Private Sub CommandButton1_Click()

Dim FoundCell As Range
Set FoundCell = Sheets("WATCH LOG").Range("A:A").Find(What:=WN.Value)
    k = FoundCell.Value

If k = WN.Value Then
        j = FoundCell.Row
            Sheets("WATCH LOG").Cells(j, 6).Value = Me.DMN.Value
            Sheets("WATCH LOG").Cells(j, 7).Value = Me.DWN.Value
            Sheets("WATCH LOG").Cells(j, 8).Value = Me.DOE.Value
End If

End Sub

Leave a Reply

Your email address will not be published. Required fields are marked *