I have a listbox.
i add the items like this that are located on my source sheet as shown.
my current code works if i select the first item every time. but any time i pick an item down the list, it adds it, but doesnt delete the selection from the row.
I need help making sure it deletes whatever i select from the source, so my list updates next time i click the macro button.
i add the items like this that are located on my source sheet as shown.
my current code works if i select the first item every time. but any time i pick an item down the list, it adds it, but doesnt delete the selection from the row.
I need help making sure it deletes whatever i select from the source, so my list updates next time i click the macro button.
Code:
Private Sub UserForm_Initialize()
Dim KLastRow As Long, K As Long
KLastRow = Sheets("Source").Range("F" & Rows.Count).End(xlUp).Row
For K = 1 To KLastRow
KList.AddItem Sheets("Source").Range("F" & K)
Next K
Private Sub KButton_Click()
ActiveCell.Value = "KR " & KList.Value
Sheets("Source").Cells(KList.ListIndex + 6).Delete xlShiftUp
Unload Me
End Sub