Hello so I have a Userform that has a listbox. When a user clicked a value from the listbox, it will be displayed on the corresponding comboboxes below, thus allowing the user to edit the value and update the row by selecting the Update Button.
mew.PNG
Sadly, I couldn't make that work and i'm going nuts. It's my first time to create a userform.
Here's my pathetic code and yes I don't have a code for Update button 
Private Sub btnDelete_Click()
Dim a As Integer
If MsgBox("Are you sure you want to delete this row?", vbYesNo + vbQuestion, "Yes") = vbYes Then
For a = 1 To Range("A100000").End(xlUp).Row
If Cells(a, 1) = listHeader.List(listHeader.ListIndex) Then
Rows(a).Select
Selection.Delete
End If
Next a
End If
End Sub
Private Sub btnView_Click()
listHeader.RowSource = "A4:H1000"
End Sub
Private Sub cmbAdd_Click()
Dim sheet As Worksheet
Set sheet = ThisWorkbook.Sheets("PRESTAGE DB")
nextrow = sheet.Cells(Rows.Count, 1).End(xlUp).Row + 1
sheet.Cells(nextrow, 1) = Me.cmbSchema
sheet.Cells(nextrow, 2) = Me.cmbEnvironment
sheet.Cells(nextrow, 3) = Me.cmbHost
sheet.Cells(nextrow, 4) = Me.cmbIP
sheet.Cells(nextrow, 5) = Me.cmbAccessible
sheet.Cells(nextrow, 6) = Me.cmbLast
sheet.Cells(nextrow, 7) = Me.cmbConfirmation
sheet.Cells(nextrow, 8) = Me.cmbProjects
End Sub
Private Sub cmbUpdate_Click()
End Sub
Private Sub CommandButton5_Click()
listHeader.RowSource = ""
End Sub
Private Sub listHeader_Click()
Dim rngMyData As Range
cmbSchema.Value = UserForm1.listHeader.Column(0)
cmbEnvironment.Value = UserForm1.listHeader.Column(1)
cmbHost.Value = UserForm1.listHeader.Column(2)
cmbIP.Value = UserForm1.listHeader.Column(3)
cmbAccessible.Value = UserForm1.listHeader.Column(4)
cmbLast.Value = UserForm1.listHeader.Column(5)
cmbConfirmation.Value = UserForm1.listHeader.Column(6)
cmbProjects.Value = UserForm1.listHeader.Column(7)
End Sub
Bookmarks