Hello
this code will replace the whole items in column B with textbox1, but what I want copy to the bottom after last row contains item every time try copy to column B .
how can I fix it, please?
this code will replace the whole items in column B with textbox1, but what I want copy to the bottom after last row contains item every time try copy to column B .
VBA Code:
Private Sub CommandButton1_Click()
Dim Rng As Range
Set Rng = Range(Range("B2"), Range("B" & Rows.Count).End(xlUp))
If Application.CountIf(Rng, Trim(TextBox1.Value)) > 0 Then
MsgBox "Match found in " & TextBox1.Name
Else
Rng = TextBox1
End If
End Sub