Llenar un Listbox dependiendo de otro Listbox y un combobox

Dispongo de una tabla con 13 columnas y quisiera hacer un formulario que al seleccionar cada uno de los campos mediante el Combobox1 vuelque los valores en el Listbox1.
Al seleccionar cada uno de estos datos del Listbox1 se deben mostrar todos los datos del valor seleccionado en el Listbox2.
Buscando y buscando he podido llegar hasta este formulario que les muestro, pero que me da ciertos problemas y tampoco logro que al modificar los datos, se actualicen en la tabla original.

¿Podrían ayudarme?. Gracias anticipadas

Private Sub ListBox1_Click(): On Error Resume Next
Application.ScreenUpdating = False
Dim Fila As Integer, Columna As Integer, Celda As String
ListBox2.Clear
Columna = Combobox1.ListIndex + 1
For Fila = 3 To Hoja2.Cells(Rows.Count, Columna).End(xlUp).Row
Celda = CStr(Hoja2.Cells(Fila, Columna))
If Celda = ListBox1 Then
ListBox2.AddItem
For j = 1 To 13
ListBox2.List(ListBox2.ListCount - 1, j - 1) = Hoja2.Cells(Fila, j)
Next
ListBox2.List(ListBox2.ListCount - 1, 13) = Fila
End If
Next
Application.ScreenUpdating = True
End Sub
Private Sub Combobox1_Change(): On Error Resume Next
Application.ScreenUpdating = False
Dim Fila As Integer, Columna As Integer, DSR As New Collection
ListBox2.Clear
ListBox1.Clear
Columna = Combobox1.ListIndex + 1
For Fila = 3 To Hoja2.Cells(Rows.Count, Columna).End(xlUp).Row
DSR.Add Hoja2.Cells(Fila, Columna), CStr(Cells(Fila, Columna))
Next
For Each Item In DSR
ListBox1.AddItem Item
Next Item
End Sub
Private Sub ListBox2_Click()
If SaltarEvento = True Then Exit Sub
Application.ScreenUpdating = False
If ListBox2.ListIndex = -1 Then Exit Sub
TextBox1 = ListBox2.List(ListBox2.ListIndex, 0)
TextBox2 = ListBox2.List(ListBox2.ListIndex, 1)
TextBox3 = ListBox2.List(ListBox2.ListIndex, 2)
TextBox4 = ListBox2.List(ListBox2.ListIndex, 3)
ComboBox5 = ListBox2.List(ListBox2.ListIndex, 4)
ComboBox6 = ListBox2.List(ListBox2.ListIndex, 5)
TextBox7 = ListBox2.List(ListBox2.ListIndex, 6)
TextBox8 = ListBox2.List(ListBox2.ListIndex, 7)
TextBox9 = ListBox2.List(ListBox2.ListIndex, 8)
ComboBox4 = ListBox2.List(ListBox2.ListIndex, 9)
TextBox13 = ListBox2.List(ListBox2.ListIndex, 10)
TextBox14 = ListBox2.List(ListBox2.ListIndex, 11)
TextBox15 = ListBox2.List(ListBox2.ListIndex, 12)
Combobox1.SetFocus
End Sub
Private Sub Modificar_Click()
Dim Fila As Integer, Columna As Integer
Application.ScreenUpdating = False
Fila = ListBox2.List(ListBox2.ListIndex, 12)
Hoja2.Cells(Fila, 3) = CDate(TextBox3)
Hoja2.Cells(Fila, 4) = CDate(TextBox4)
Hoja2.Cells(Fila, 5) = ComboBox5
Hoja2.Cells(Fila, 6) = ComboBox6
Hoja2.Cells(Fila, 7) = TextBox7
Hoja2.Cells(Fila, 8) = CDate(TextBox8)
Hoja2.Cells(Fila, 9) = CDate(TextBox9)
Hoja2.Cells(Fila, 10) = ComboBox4
Hoja2.Cells(Fila, 11) = TextBox13
Hoja2.Cells(Fila, 12) = TextBox14
Hoja2.Cells(Fila, 13) = TextBox15
Application.ScreenUpdating = True
End Sub
Private Sub UserForm_Initialize()
Application.Visible = True
Application.ScreenUpdating = False
Hoja2.Select
Set rango = Hoja9.Range("Tabla122[S]")
For Each Celda In rango
ComboBox4.AddItem Celda.Value
Next Celda
Set rango = Hoja9.Range("Tabla144[R]")
For Each Celda In rango
ComboBox6.AddItem Celda.Value
Next Celda
Set rango = Hoja9.Range("Tabla155[P]")
For Each Celda In rango
ComboBox5.AddItem Celda.Value
Next Celda

ListBox2.ColumnCount = 13
ListBox2.List = Range(Cells(1, 1), Cells(1, 13)).Value '
ListBox2.Clear

Label1.Caption = Hoja2.Cells(2, 1)
Label2.Caption = Hoja2.Cells(2, 2)
Label3.Caption = Hoja2.Cells(2, 3)
Label4.Caption = Hoja2.Cells(2, 4)

Label5.Caption = Hoja2.Cells(2, 5)
Label6.Caption = Hoja2.Cells(2, 6)
Label7.Caption = Hoja2.Cells(2, 7)
Label8.Caption = Hoja2.Cells(2, 8)
Label9.Caption = Hoja2.Cells(2, 9)
Label10.Caption = Hoja2.Cells(2, 10)
Label13.Caption = Hoja2.Cells(2, 11)
Label14.Caption = Hoja2.Cells(2, 12)
Label15.Caption = Hoja2.Cells(2, 13)

Label55.Caption = Hoja2.Cells(2, 5)
Label66.Caption = Hoja2.Cells(2, 6)
Label77.Caption = Hoja2.Cells(2, 7)
Label88.Caption = Hoja2.Cells(2, 8)
Label99.Caption = Hoja2.Cells(2, 9)
Label100.Caption = Hoja2.Cells(2, 10)
Label133.Caption = Hoja2.Cells(2, 11)
Label144.Caption = Hoja2.Cells(2, 12)
Label155.Caption = Hoja2.Cells(2, 13)

Label11 = ""
Label12 = ""
For j = 1 To 13: Combobox1.AddItem Hoja2.Cells(2, j): Next

ListBox2.ColumnWidths = "0;0;0;0;12;12;50;50;50;60;60;60;60"
Combobox1. SetFocus
ListBox2. SetFocus
End Sub

Añade tu respuesta

Haz clic para o