List Box Populating problem

E

Ewing25

Im trying to get the listbox to populate from column H in a worksheet named
Expense. Here is the code i have already:

Private Sub CommandButton1_Click()
Set wks = Worksheets("Miles")
lrA = wks.Cells(Rows.Count, 1).End(xlUp).Row
lrB = wks.Cells(Rows.Count, 2).End(xlUp).Row

wks.Range("A" & lrA + 1) = ListBox1.Text
wks.Range("B" & lrA + 1) = TextBox1.Text

TextBox1.Text = ""

End Sub

Private Sub CommandButton2_Click()
Unload UserForm3
End Sub

I cant figure out how to get it to populate without duplicates if soemone
enters the same value twice.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top