Hello all,
I use the following code to delete an item selected on a listbox.
The listbox is on an userform together with some textboxes.
The values of the selected item on the listbox are retrieved from a database and shown in the textboxes.
Now i'd like to make an "adjust" button to amend the data from these textboxes. For this I need the code to select the cells, linked to the selected item in the listbox.
Ideas?
I use the following code to delete an item selected on a listbox.
The listbox is on an userform together with some textboxes.
The values of the selected item on the listbox are retrieved from a database and shown in the textboxes.
Now i'd like to make an "adjust" button to amend the data from these textboxes. For this I need the code to select the cells, linked to the selected item in the listbox.
Ideas?
Code:
Private Sub cmbDelete_Click()
Application.ScreenUpdating = False
'REMOVE SELECTION
Dim I As Long
With Me.ListBox1
For I = .ListCount - 1 To 0 Step -1
If .Selected(I) Then Sheets("DATA").Rows(I + 1).EntireRow.Delete
Next I
End With
UserForm_Initialize
Application.ScreenUpdating = True
End Sub